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 enumThe API type that the extension is used for.static enumType of a message extension. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ObjectfromReflectionType(Object value) abstract TypeReturns the default value of the extension field.abstract Descriptors.FieldDescriptorReturns the descriptor of the extension.protected Extension.ExtensionTypeabstract WireFormat.FieldTypeReturns the type of the field.abstract MessageLiteReturns 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 intReturns the field number of the extension.abstract booleanReturns whether it is a repeated field.protected abstract ObjectsingularFromReflectionType(Object value) protected abstract ObjectsingularToReflectionType(Object value) protected abstract ObjecttoReflectionType(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
-