Class CField
- java.lang.Object
-
- net.morimekta.providence.reflect.contained.CField
-
- All Implemented Interfaces:
net.morimekta.providence.descriptor.PField
,CAnnotatedDescriptor
- Direct Known Subclasses:
CConst
public class CField extends java.lang.Object implements net.morimekta.providence.descriptor.PField, CAnnotatedDescriptor
Description of a single contained field. Part of the message descriptor.
-
-
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.PValueProvider defaultValue, java.util.Map<java.lang.String,java.lang.String> annotations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.util.Set<java.lang.String>
getAnnotations()
Get set of available annotations.java.lang.String
getAnnotationValue(java.lang.String name)
Get the given annotation value.java.lang.Object
getDefaultValue()
net.morimekta.providence.descriptor.PDescriptor
getDescriptor()
java.lang.String
getDocumentation()
The type comment is the last block of comment written before the type declaration.int
getId()
java.lang.String
getName()
net.morimekta.providence.descriptor.PRequirement
getRequirement()
net.morimekta.providence.PType
getType()
boolean
hasAnnotation(java.lang.String name)
Get the given annotation value.boolean
hasDefaultValue()
int
hashCode()
java.lang.String
toString()
-
Methods inherited from interface net.morimekta.providence.reflect.contained.CAnnotatedDescriptor
getAnnotationValue, hasAnnotation
-
-
-
-
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.PValueProvider defaultValue, @Nullable java.util.Map<java.lang.String,java.lang.String> annotations)
-
-
Method Detail
-
getDocumentation
public java.lang.String getDocumentation()
Description copied from interface:CAnnotatedDescriptor
The 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:
getDocumentation
in interfaceCAnnotatedDescriptor
- Returns:
- The comment string containing all formatting (not including the comment delimiter and the leading space.
-
getId
public int getId()
- Specified by:
getId
in interfacenet.morimekta.providence.descriptor.PField
-
getRequirement
@Nonnull public net.morimekta.providence.descriptor.PRequirement getRequirement()
- Specified by:
getRequirement
in interfacenet.morimekta.providence.descriptor.PField
-
getType
@Nonnull public net.morimekta.providence.PType getType()
- Specified by:
getType
in interfacenet.morimekta.providence.descriptor.PField
-
getDescriptor
@Nonnull public net.morimekta.providence.descriptor.PDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfacenet.morimekta.providence.descriptor.PField
-
getName
@Nonnull public java.lang.String getName()
- Specified by:
getName
in interfacenet.morimekta.providence.descriptor.PField
-
hasDefaultValue
public boolean hasDefaultValue()
- Specified by:
hasDefaultValue
in interfacenet.morimekta.providence.descriptor.PField
-
getDefaultValue
public java.lang.Object getDefaultValue()
- Specified by:
getDefaultValue
in interfacenet.morimekta.providence.descriptor.PField
-
getAnnotations
@Nonnull public java.util.Set<java.lang.String> getAnnotations()
Description copied from interface:CAnnotatedDescriptor
Get set of available annotations.- Specified by:
getAnnotations
in interfaceCAnnotatedDescriptor
- Returns:
- The annotation set.
-
hasAnnotation
public boolean hasAnnotation(@Nonnull java.lang.String name)
Description copied from interface:CAnnotatedDescriptor
Get the given annotation value.- Specified by:
hasAnnotation
in 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:CAnnotatedDescriptor
Get the given annotation value.- Specified by:
getAnnotationValue
in interfaceCAnnotatedDescriptor
- Parameters:
name
- Name of annotation.- Returns:
- The annotation value or null.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-