Class CEnumDescriptor
- java.lang.Object
-
- net.morimekta.providence.descriptor.PDeclaredDescriptor<T>
-
- net.morimekta.providence.descriptor.PEnumDescriptor<CEnumValue>
-
- net.morimekta.providence.reflect.contained.CEnumDescriptor
-
- All Implemented Interfaces:
net.morimekta.providence.descriptor.PDescriptor,CAnnotatedDescriptor
public class CEnumDescriptor extends net.morimekta.providence.descriptor.PEnumDescriptor<CEnumValue> implements CAnnotatedDescriptor
Contained enum descriptor type.Also see
CEnumValue.
-
-
Constructor Summary
Constructors Constructor Description CEnumDescriptor(java.lang.String comment, java.lang.String packageName, java.lang.String name, java.util.Map<java.lang.String,java.lang.String> annotations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CEnumValuefindById(int id)CEnumValuefindByName(java.lang.String name)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.CEnumValue[]getValues()booleanhasAnnotation(java.lang.String name)Get the given annotation value.voidsetValues(java.util.List<CEnumValue> values)-
Methods inherited from class net.morimekta.providence.descriptor.PEnumDescriptor
builder, equals, getBuilderSupplier, getType, hashCode, toString, valueForId, valueForName
-
Methods inherited from class net.morimekta.providence.descriptor.PDeclaredDescriptor
getDefaultValue, getName, getProgramName, getQualifiedName
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.reflect.contained.CAnnotatedDescriptor
getAnnotationValue, hasAnnotation
-
-
-
-
Method Detail
-
setValues
public void setValues(@Nonnull java.util.List<CEnumValue> values)
-
getDocumentation
public final 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.
-
getValues
@Nonnull public CEnumValue[] getValues()
- Specified by:
getValuesin classnet.morimekta.providence.descriptor.PEnumDescriptor<CEnumValue>
-
findById
@Nullable public CEnumValue findById(int id)
- Specified by:
findByIdin classnet.morimekta.providence.descriptor.PEnumDescriptor<CEnumValue>
-
findByName
@Nullable public CEnumValue findByName(java.lang.String name)
- Specified by:
findByNamein classnet.morimekta.providence.descriptor.PEnumDescriptor<CEnumValue>
-
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.
-
-