Class CInterfaceDescriptor
- java.lang.Object
-
- net.morimekta.providence.descriptor.PDeclaredDescriptor<T>
-
- net.morimekta.providence.descriptor.PMessageDescriptor<T>
-
- net.morimekta.providence.descriptor.PInterfaceDescriptor<CInterface>
-
- net.morimekta.providence.reflect.contained.CInterfaceDescriptor
-
- All Implemented Interfaces:
java.lang.reflect.Type
,PDescriptor
,CAnnotatedDescriptor
,CMessageDescriptor
public class CInterfaceDescriptor extends PInterfaceDescriptor<CInterface> implements CMessageDescriptor
Descriptor for an interface. Note that this does not have an equivalent in providence-core, as these interfaces are there for the code generation. They do not alter serialization.
-
-
Constructor Summary
Constructors Constructor Description CInterfaceDescriptor(java.lang.String comment, java.lang.String packageName, java.lang.String name, java.util.List<CField<CInterface>> fields, java.util.Map<java.lang.String,java.lang.String> annotations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPossibleType(PMessageDescriptor<?> descriptor)
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.String
getDocumentation()
The type comment is the last block of comment written before the type declaration.CInterfaceDescriptor
getImplementing()
Get interface descriptor this message implements.java.util.List<PMessageDescriptor<?>>
getPossibleTypes()
boolean
hasAnnotation(java.lang.String name)
Get the given annotation value.-
Methods inherited from class net.morimekta.providence.descriptor.PInterfaceDescriptor
builder, findFieldById, findFieldByName, findFieldByPojoName, getFields, getVariant, isAutoType, isInnerType
-
Methods inherited from class net.morimekta.providence.descriptor.PMessageDescriptor
equals, fieldForId, fieldForName, fieldForPojoName, getBuilderSupplier, getType, hashCode, isSimple
-
Methods inherited from class net.morimekta.providence.descriptor.PDeclaredDescriptor
getDefaultValue, 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.reflect.contained.CMessageDescriptor
fieldForId, fieldForName, findFieldById, findFieldByName, getFields, getVariant, isSimple
-
Methods inherited from interface net.morimekta.providence.descriptor.PDescriptor
getDefaultValue, getName, getProgramName, getQualifiedName, getQualifiedName, getType
-
-
-
-
Constructor Detail
-
CInterfaceDescriptor
public CInterfaceDescriptor(java.lang.String comment, java.lang.String packageName, java.lang.String name, java.util.List<CField<CInterface>> fields, java.util.Map<java.lang.String,java.lang.String> annotations)
-
-
Method Detail
-
addPossibleType
public void addPossibleType(PMessageDescriptor<?> descriptor)
-
getPossibleTypes
public java.util.List<PMessageDescriptor<?>> getPossibleTypes()
- Overrides:
getPossibleTypes
in classPInterfaceDescriptor<CInterface>
- Returns:
- Get a list of know possible types implementing this interface.
-
getDocumentation
public final 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.
-
getImplementing
@Nullable public CInterfaceDescriptor getImplementing()
Description copied from class:PMessageDescriptor
Get interface descriptor this message implements.- Specified by:
getImplementing
in interfaceCMessageDescriptor
- Overrides:
getImplementing
in classPMessageDescriptor<CInterface>
- Returns:
- The interface descriptor or null if not implementing declared interface.
-
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.
-
-