Class CConst
- java.lang.Object
-
- net.morimekta.providence.descriptor.PDeclaredDescriptor<java.lang.Object>
-
- net.morimekta.providence.reflect.contained.CConst
-
- All Implemented Interfaces:
java.lang.reflect.Type
,PDescriptor
,CAnnotatedDescriptor
public class CConst extends PDeclaredDescriptor<java.lang.Object> implements CAnnotatedDescriptor
First stage before we have a totally separate CConst from the CField contained type class.
-
-
Constructor Summary
Constructors Constructor Description CConst(java.lang.String docs, java.lang.String programName, java.lang.String name, PDescriptorProvider typeProvider, PValueProvider<?> valueProvider, 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()
PDescriptor
getDescriptor()
java.lang.String
getDocumentation()
The type comment is the last block of comment written before the type declaration.PType
getType()
boolean
hasAnnotation(java.lang.String name)
Get the given annotation value.boolean
hasDefaultValue()
int
hashCode()
boolean
isAutoType()
boolean
isInnerType()
-
Methods inherited from class net.morimekta.providence.descriptor.PDeclaredDescriptor
getName, getProgramName, getQualifiedName, getTypeName, toString
-
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
-
Methods inherited from interface net.morimekta.providence.descriptor.PDescriptor
getQualifiedName
-
-
-
-
Constructor Detail
-
CConst
public CConst(@Nullable java.lang.String docs, @Nonnull java.lang.String programName, @Nonnull java.lang.String name, @Nonnull PDescriptorProvider typeProvider, @Nonnull PValueProvider<?> valueProvider, @Nullable java.util.Map<java.lang.String,java.lang.String> annotations)
-
-
Method Detail
-
isInnerType
public boolean isInnerType()
- Specified by:
isInnerType
in classPDeclaredDescriptor<java.lang.Object>
- Returns:
- Returns true if the type is an inner type. Meaning it is contained within another type or service.
-
isAutoType
public boolean isAutoType()
- Specified by:
isAutoType
in classPDeclaredDescriptor<java.lang.Object>
- Returns:
- Returns true if the type is generated automatically by means of something else, e.g. request and response types for services. Or is a built in type as part of providence itself.
-
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.
-
getDescriptor
@Nonnull public PDescriptor getDescriptor()
-
hasDefaultValue
public boolean hasDefaultValue()
-
getDefaultValue
public java.lang.Object getDefaultValue()
- Specified by:
getDefaultValue
in interfacePDescriptor
- Overrides:
getDefaultValue
in classPDeclaredDescriptor<java.lang.Object>
- Returns:
- The default value for the type used for default and required fields. Note that some primitive types don't support null values, and will have methods returning a default value regardless of the field required value setting.
-
getType
@Nonnull public PType getType()
- Specified by:
getType
in interfacePDescriptor
- Returns:
- Get the field type.
-
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.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-