Class PDeclaredDescriptor<T>
- java.lang.Object
-
- net.morimekta.providence.descriptor.PDeclaredDescriptor<T>
-
- All Implemented Interfaces:
java.lang.reflect.Type,PDescriptor
- Direct Known Subclasses:
PEnumDescriptor,PMessageDescriptor,PService
public abstract class PDeclaredDescriptor<T> extends java.lang.Object implements PDescriptor, java.lang.reflect.Type
Descriptor for a declared type. A declared type is a value type that is derived from a thrift definition.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPDeclaredDescriptor(java.lang.String programName, java.lang.String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TgetDefaultValue()java.lang.StringgetName()The name of the type is the Identifier string from the IDL.java.lang.StringgetProgramName()The package name is derived form the .thrift file name that is parsed or if read from serialized format is explicit.java.lang.StringgetQualifiedName(java.lang.String programContext)This will return the qualified name of the type given the program context.java.lang.StringgetTypeName()abstract booleanisAutoType()abstract booleanisInnerType()java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.descriptor.PDescriptor
getQualifiedName, getType
-
-
-
-
Method Detail
-
getTypeName
@Nonnull public java.lang.String getTypeName()
- Specified by:
getTypeNamein interfacejava.lang.reflect.Type
-
getProgramName
@Nonnull public final java.lang.String getProgramName()
Description copied from interface:PDescriptorThe package name is derived form the .thrift file name that is parsed or if read from serialized format is explicit. Note that there may be package name conflicts globally.- Specified by:
getProgramNamein interfacePDescriptor- Returns:
- The program name of the type. If empty the type is not in any named program, e.g. primitives.
-
getName
@Nonnull public final java.lang.String getName()
Description copied from interface:PDescriptorThe name of the type is the Identifier string from the IDL.- Specified by:
getNamein interfacePDescriptor- Returns:
- The name of the type. Not including package.
-
getQualifiedName
@Nonnull public final java.lang.String getQualifiedName(java.lang.String programContext)
Description copied from interface:PDescriptorThis will return the qualified name of the type given the program context.- Specified by:
getQualifiedNamein interfacePDescriptor- Parameters:
programContext- The program which the type should be referenced from.- Returns:
- The qualified name of the type. Including program if not matching with programContext.
-
getDefaultValue
@Nullable public T getDefaultValue()
- Specified by:
getDefaultValuein interfacePDescriptor- 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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isInnerType
public abstract boolean isInnerType()
- Returns:
- Returns true if the type is an inner type. Meaning it is contained within another type or service.
-
isAutoType
public abstract boolean isAutoType()
- 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.
-
-