Package com.google.protobuf
Class Extension<ContainingType extends MessageLite,Type>
java.lang.Object
com.google.protobuf.ExtensionLite<ContainingType,Type>
com.google.protobuf.Extension<ContainingType,Type>
- Direct Known Subclasses:
GeneratedMessage.GeneratedExtension
public abstract class Extension<ContainingType extends MessageLite,Type>
extends ExtensionLite<ContainingType,Type>
Interface that generated extensions implement.
-
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 Descriptors.FieldDescriptorReturns the descriptor of the extension.protected abstract Extension.ExtensionTypeabstract MessageReturns 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.(package private) final booleanisLite()Returns whether or not this extension is a Lite Extension.protected abstract ObjectsingularFromReflectionType(Object value) protected abstract ObjectsingularToReflectionType(Object value) protected abstract ObjecttoReflectionType(Object value) Methods inherited from class com.google.protobuf.ExtensionLite
getDefaultValue, getLiteType, getNumber, isRepeated
-
Constructor Details
-
Extension
public Extension()
-
-
Method Details
-
getMessageDefaultInstance
Returns the default instance of the extension field, if it's a message extension. Overridden to returnMessageinstead ofMessageLite.- Specified by:
getMessageDefaultInstancein classExtensionLite<ContainingType extends MessageLite,Type>
-
getDescriptor
Returns the descriptor of the extension. -
isLite
final boolean isLite()Returns whether or not this extension is a Lite Extension.- Overrides:
isLitein classExtensionLite<ContainingType extends MessageLite,Type>
-
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
-