Package com.google.protobuf
Class Extension<ContainingType extends MessageLite,Type>
java.lang.Object
com.google.protobuf.Extension<ContainingType,Type>
- Direct Known Subclasses:
GeneratedMessage.GeneratedExtension
Interface that generated extensions implement.
- Author:
- liujisi@google.com (Jisi Liu)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum
The API type that the extension is used for.static enum
Type of a message extension. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Object
fromReflectionType
(Object value) abstract Type
Returns the default value of the extension field.abstract Descriptors.FieldDescriptor
Returns the descriptor of the extension.protected Extension.ExtensionType
abstract WireFormat.FieldType
Returns the type of the field.abstract MessageLite
Returns the default instance of the extension field, if it's a message extension.If the extension is a message extension (i.e., getLiteType() == MESSAGE), returns the type of the message, otherwise undefined.abstract int
Returns the field number of the extension.abstract boolean
Returns whether it is a repeated field.protected abstract Object
singularFromReflectionType
(Object value) protected abstract Object
singularToReflectionType
(Object value) protected abstract Object
toReflectionType
(Object value)
-
Constructor Details
-
Extension
public Extension()
-
-
Method Details
-
getNumber
public abstract int getNumber()Returns the field number of the extension. -
getLiteType
Returns the type of the field. -
isRepeated
public abstract boolean isRepeated()Returns whether it is a repeated field. -
getDescriptor
Returns the descriptor of the extension. -
getDefaultValue
Returns the default value of the extension field. -
getMessageDefaultInstance
Returns the default instance of the extension field, if it's a message extension. -
getExtensionType
-
getMessageType
If the extension is a message extension (i.e., getLiteType() == MESSAGE), returns the type of the message, otherwise undefined. -
fromReflectionType
-
singularFromReflectionType
-
toReflectionType
-
singularToReflectionType
-