Class PDeclaredDescriptor<T>
- java.lang.Object
-
- net.morimekta.providence.descriptor.PDeclaredDescriptor<T>
-
- All Implemented Interfaces:
PDescriptor
- Direct Known Subclasses:
PEnumDescriptor,PMessageDescriptor
public abstract class PDeclaredDescriptor<T> extends java.lang.Object implements PDescriptor
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 abstract PBuilder<T>builder()Get the builder for the given declared type.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.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
-
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
-
-