Class CEnumValue
- java.lang.Object
-
- net.morimekta.providence.reflect.contained.CEnumValue
-
- All Implemented Interfaces:
java.lang.Comparable<CEnumValue>,net.morimekta.providence.PEnumValue<CEnumValue>,net.morimekta.providence.PValue<CEnumValue>,CAnnotatedDescriptor,net.morimekta.util.Numeric,net.morimekta.util.Stringable
public class CEnumValue extends java.lang.Object implements net.morimekta.providence.PEnumValue<CEnumValue>, CAnnotatedDescriptor
Contained enum value. This emulates enum values to used in thrift reflection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCEnumValue.Builder
-
Constructor Summary
Constructors Constructor Description CEnumValue(java.lang.String comment, int value, java.lang.String name, net.morimekta.providence.descriptor.PEnumDescriptor<CEnumValue> type, java.util.Map<java.lang.String,java.lang.String> annotations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intasInteger()java.lang.StringasString()intcompareTo(CEnumValue other)net.morimekta.providence.descriptor.PEnumDescriptor<CEnumValue>descriptor()booleanequals(java.lang.Object o)java.util.Set<java.lang.String>getAnnotations()Get set of available annotations.java.lang.StringgetAnnotationValue(java.lang.String name)Get the given annotation value.java.lang.StringgetDocumentation()The type comment is the last block of comment written before the type declaration.booleanhasAnnotation(java.lang.String name)Get the given annotation value.inthashCode()java.lang.StringtoString()-
Methods inherited from interface net.morimekta.providence.reflect.contained.CAnnotatedDescriptor
getAnnotationValue, hasAnnotation
-
-
-
-
Constructor Detail
-
CEnumValue
public CEnumValue(@Nullable java.lang.String comment, int value, @Nonnull java.lang.String name, @Nonnull net.morimekta.providence.descriptor.PEnumDescriptor<CEnumValue> type, @Nullable java.util.Map<java.lang.String,java.lang.String> annotations)
-
-
Method Detail
-
getDocumentation
public java.lang.String getDocumentation()
Description copied from interface:CAnnotatedDescriptorThe type comment is the last block of comment written before the type declaration. Comments on the same line, after the declaration is ignored.- Specified by:
getDocumentationin interfaceCAnnotatedDescriptor- Returns:
- The comment string containing all formatting (not including the comment delimiter and the leading space.
-
asInteger
public int asInteger()
- Specified by:
asIntegerin interfacenet.morimekta.util.Numeric
-
asString
@Nonnull public java.lang.String asString()
- Specified by:
asStringin interfacenet.morimekta.util.Stringable
-
getAnnotations
@Nonnull public java.util.Set<java.lang.String> getAnnotations()
Description copied from interface:CAnnotatedDescriptorGet set of available annotations.- Specified by:
getAnnotationsin interfaceCAnnotatedDescriptor- Returns:
- The annotation set.
-
hasAnnotation
public boolean hasAnnotation(@Nonnull java.lang.String name)Description copied from interface:CAnnotatedDescriptorGet the given annotation value.- Specified by:
hasAnnotationin interfaceCAnnotatedDescriptor- Parameters:
name- Name of annotation.- Returns:
- If the annotation is present.
-
getAnnotationValue
public java.lang.String getAnnotationValue(@Nonnull java.lang.String name)Description copied from interface:CAnnotatedDescriptorGet the given annotation value.- Specified by:
getAnnotationValuein interfaceCAnnotatedDescriptor- Parameters:
name- Name of annotation.- Returns:
- The annotation value or null.
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PEnumDescriptor<CEnumValue> descriptor()
- Specified by:
descriptorin interfacenet.morimekta.providence.PEnumValue<CEnumValue>- Specified by:
descriptorin interfacenet.morimekta.providence.PValue<CEnumValue>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(@Nonnull CEnumValue other)- Specified by:
compareToin interfacejava.lang.Comparable<CEnumValue>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-