Class Extension<ContainingType extends MessageLite,​Type>

  • Direct Known Subclasses:
    GeneratedMessage.GeneratedExtension

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

      • Extension

        public Extension()
    • Method Detail

      • getNumber

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

        public abstract boolean isRepeated()
        Returns whether it is a repeated field.
      • 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.
      • 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 java.lang.Object fromReflectionType​(java.lang.Object value)
      • singularFromReflectionType

        protected abstract java.lang.Object singularFromReflectionType​(java.lang.Object value)
      • toReflectionType

        protected abstract java.lang.Object toReflectionType​(java.lang.Object value)
      • singularToReflectionType

        protected abstract java.lang.Object singularToReflectionType​(java.lang.Object value)