Class 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
      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
      abstract PBuilder<T> builder()
      Get the builder for the given declared type.
      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 toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PDeclaredDescriptor

        protected PDeclaredDescriptor​(@Nonnull
                                      java.lang.String programName,
                                      @Nonnull
                                      java.lang.String name)
    • Method Detail

      • 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 interface PDescriptor
        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 interface PDescriptor
        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 interface PDescriptor
        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 interface PDescriptor
        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 class java.lang.Object
      • builder

        @Nonnull
        public abstract PBuilder<T> builder()
        Get the builder for the given declared type.
        Returns:
        The type specific builder provider.