Class CField<M extends net.morimekta.providence.PMessage<M>>
- java.lang.Object
-
- net.morimekta.providence.reflect.contained.CField<M>
-
- Type Parameters:
M- The message type.
- All Implemented Interfaces:
net.morimekta.providence.descriptor.PField<M>,CAnnotatedDescriptor
public class CField<M extends net.morimekta.providence.PMessage<M>> extends java.lang.Object implements net.morimekta.providence.descriptor.PField<M>, CAnnotatedDescriptor
Description of a single contained field. Part of the message descriptor.
-
-
Field Summary
Fields Modifier and Type Field Description static CField<?>[]EMPTY_ARRAY
-
Constructor Summary
Constructors Constructor Description CField(java.lang.String docs, int id, net.morimekta.providence.descriptor.PRequirement requirement, java.lang.String name, net.morimekta.providence.descriptor.PDescriptorProvider typeProvider, net.morimekta.providence.descriptor.PStructDescriptorProvider<?> argumentsProvider, net.morimekta.providence.descriptor.PValueProvider<?> defaultValue, java.util.Map<java.lang.String,java.lang.String> annotations, net.morimekta.providence.descriptor.PDescriptorProvider implementing)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.net.morimekta.providence.descriptor.PStructDescriptor<?>getArgumentsType()java.lang.ObjectgetDefaultValue()net.morimekta.providence.descriptor.PDescriptorgetDescriptor()java.lang.StringgetDocumentation()The type comment is the last block of comment written before the type declaration.intgetId()java.lang.StringgetName()java.lang.StringgetPojoName()net.morimekta.providence.descriptor.PRequirementgetRequirement()booleanhasAnnotation(java.lang.String name)Get the given annotation value.booleanhasDefaultValue()inthashCode()net.morimekta.providence.descriptor.PMessageDescriptor<M>onMessageType()java.lang.StringtoString()-
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
-
-
-
-
Field Detail
-
EMPTY_ARRAY
public static final CField<?>[] EMPTY_ARRAY
-
-
Constructor Detail
-
CField
public CField(@Nullable java.lang.String docs, int id, @Nonnull net.morimekta.providence.descriptor.PRequirement requirement, @Nonnull java.lang.String name, @Nonnull net.morimekta.providence.descriptor.PDescriptorProvider typeProvider, @Nullable net.morimekta.providence.descriptor.PStructDescriptorProvider<?> argumentsProvider, @Nullable net.morimekta.providence.descriptor.PValueProvider<?> defaultValue, @Nullable java.util.Map<java.lang.String,java.lang.String> annotations, @Nullable net.morimekta.providence.descriptor.PDescriptorProvider implementing)
-
-
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.
-
getId
public int getId()
-
getRequirement
@Nonnull public net.morimekta.providence.descriptor.PRequirement getRequirement()
-
getDescriptor
@Nonnull public net.morimekta.providence.descriptor.PDescriptor getDescriptor()
-
getArgumentsType
public net.morimekta.providence.descriptor.PStructDescriptor<?> getArgumentsType()
-
getName
@Nonnull public java.lang.String getName()
-
getPojoName
@Nonnull public java.lang.String getPojoName()
-
hasDefaultValue
public boolean hasDefaultValue()
-
getDefaultValue
public java.lang.Object getDefaultValue()
-
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.
-
onMessageType
@Nonnull public net.morimekta.providence.descriptor.PMessageDescriptor<M> onMessageType()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-