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 protected
PDeclaredDescriptor(java.lang.String programName, java.lang.String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
getDefaultValue()
java.lang.String
getName()
The name of the type is the Identifier string from the IDL.java.lang.String
getProgramName()
The package name is derived form the .thrift file name that is parsed or if read from serialized format is explicit.java.lang.String
getQualifiedName(java.lang.String programContext)
This will return the qualified name of the type given the program context.java.lang.String
getTypeName()
abstract boolean
isAutoType()
abstract boolean
isInnerType()
java.lang.String
toString()
-
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:
getTypeName
in interfacejava.lang.reflect.Type
-
getProgramName
@Nonnull public final java.lang.String getProgramName()
Description copied from interface:PDescriptor
The 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:
getProgramName
in 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:PDescriptor
The name of the type is the Identifier string from the IDL.- Specified by:
getName
in 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:PDescriptor
This will return the qualified name of the type given the program context.- Specified by:
getQualifiedName
in 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:
getDefaultValue
in 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:
toString
in 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.
-
-