Class Extension<ContainingType extends MessageLite,Type>

java.lang.Object
com.google.protobuf.Extension<ContainingType,Type>
Direct Known Subclasses:
GeneratedMessage.GeneratedExtension

public abstract class Extension<ContainingType extends MessageLite,Type> extends Object
Interface that generated extensions implement.
Author:
liujisi@google.com (Jisi Liu)
  • Constructor Details

    • Extension

      public Extension()
  • Method Details

    • getNumber

      public abstract int getNumber()
      Returns the field number of the extension.
    • getLiteType

      public abstract WireFormat.FieldType getLiteType()
      Returns the type of the field.
    • isRepeated

      public abstract boolean isRepeated()
      Returns whether it is a repeated field.
    • getDescriptor

      public abstract Descriptors.FieldDescriptor getDescriptor()
      Returns the descriptor of the extension.
    • getDefaultValue

      public abstract Type getDefaultValue()
      Returns the default value of the extension field.
    • getMessageDefaultInstance

      public abstract MessageLite getMessageDefaultInstance()
      Returns the default instance of the extension field, if it's a message extension.
    • getExtensionType

      protected Extension.ExtensionType getExtensionType()
    • getMessageType

      public Extension.MessageType getMessageType()
      If the extension is a message extension (i.e., getLiteType() == MESSAGE), returns the type of the message, otherwise undefined.
    • fromReflectionType

      protected abstract Object fromReflectionType(Object value)
    • singularFromReflectionType

      protected abstract Object singularFromReflectionType(Object value)
    • toReflectionType

      protected abstract Object toReflectionType(Object value)
    • singularToReflectionType

      protected abstract Object singularToReflectionType(Object value)