Package com.google.protobuf
Class GeneratedMessageLite.GeneratedExtension<ContainingType extends MessageLite,Type>
java.lang.Object
com.google.protobuf.ExtensionLite<ContainingType,Type>
com.google.protobuf.GeneratedMessageLite.GeneratedExtension<ContainingType,Type>
- Enclosing class:
- GeneratedMessageLite<MessageType extends GeneratedMessageLite<MessageType,
BuilderType>, BuilderType extends GeneratedMessageLite.Builder<MessageType, BuilderType>>
public static class GeneratedMessageLite.GeneratedExtension<ContainingType extends MessageLite,Type>
extends ExtensionLite<ContainingType,Type>
Lite equivalent to
GeneratedMessage.GeneratedExtension.
Users should ignore the contents of this class and only use objects of this type as parameters to extension accessors and ExtensionRegistry.add().
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ContainingType(package private) final Type(package private) final GeneratedMessageLite.ExtensionDescriptor(package private) final MessageLite -
Constructor Summary
ConstructorsConstructorDescriptionGeneratedExtension(ContainingType containingTypeDefaultInstance, Type defaultValue, MessageLite messageDefaultInstance, GeneratedMessageLite.ExtensionDescriptor descriptor, Class singularType) Create a new instance with the given parameters. -
Method Summary
Modifier and TypeMethodDescription(package private) ObjectfromFieldSetType(Object value) Default instance of the type being extended, used to identify that type.Returns the default value of the extension field.Returns the type of the field.If the extension is an embedded message or group, returns the default instance of the message.intGet the field number.booleanReturns whether it is a repeated field.(package private) ObjectsingularFromFieldSetType(Object value) (package private) ObjectsingularToFieldSetType(Object value) (package private) ObjecttoFieldSetType(Object value) Methods inherited from class com.google.protobuf.ExtensionLite
isLite
-
Field Details
-
containingTypeDefaultInstance
-
defaultValue
-
messageDefaultInstance
-
descriptor
-
-
Constructor Details
-
GeneratedExtension
GeneratedExtension(ContainingType containingTypeDefaultInstance, Type defaultValue, MessageLite messageDefaultInstance, GeneratedMessageLite.ExtensionDescriptor descriptor, Class singularType) Create a new instance with the given parameters.The last parameter
singularTypeis only needed for enum types. We store integer values for enum types in aGeneratedMessageLite.ExtendableMessageand use Java reflection to convert an integer value back into a concrete enum object.
-
-
Method Details
-
getContainingTypeDefaultInstance
Default instance of the type being extended, used to identify that type. -
getNumber
public int getNumber()Get the field number.- Specified by:
getNumberin classExtensionLite<ContainingType extends MessageLite,Type>
-
getMessageDefaultInstance
If the extension is an embedded message or group, returns the default instance of the message.- Specified by:
getMessageDefaultInstancein classExtensionLite<ContainingType extends MessageLite,Type>
-
fromFieldSetType
-
singularFromFieldSetType
-
toFieldSetType
-
singularToFieldSetType
-
getLiteType
Description copied from class:ExtensionLiteReturns the type of the field.- Specified by:
getLiteTypein classExtensionLite<ContainingType extends MessageLite,Type>
-
isRepeated
public boolean isRepeated()Description copied from class:ExtensionLiteReturns whether it is a repeated field.- Specified by:
isRepeatedin classExtensionLite<ContainingType extends MessageLite,Type>
-
getDefaultValue
Description copied from class:ExtensionLiteReturns the default value of the extension field.- Specified by:
getDefaultValuein classExtensionLite<ContainingType extends MessageLite,Type>
-