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 toGeneratedMessage.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
Fields Modifier and Type Field Description (package private) ContainingType
containingTypeDefaultInstance
(package private) Type
defaultValue
(package private) GeneratedMessageLite.ExtensionDescriptor
descriptor
(package private) MessageLite
messageDefaultInstance
-
Constructor Summary
Constructors Constructor Description GeneratedExtension(ContainingType containingTypeDefaultInstance, Type defaultValue, MessageLite messageDefaultInstance, GeneratedMessageLite.ExtensionDescriptor descriptor, java.lang.Class singularType)
Create a new instance with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.Object
fromFieldSetType(java.lang.Object value)
ContainingType
getContainingTypeDefaultInstance()
Default instance of the type being extended, used to identify that type.Type
getDefaultValue()
Returns the default value of the extension field.WireFormat.FieldType
getLiteType()
Returns the type of the field.MessageLite
getMessageDefaultInstance()
If the extension is an embedded message or group, returns the default instance of the message.int
getNumber()
Get the field number.boolean
isRepeated()
Returns whether it is a repeated field.(package private) java.lang.Object
singularFromFieldSetType(java.lang.Object value)
(package private) java.lang.Object
singularToFieldSetType(java.lang.Object value)
(package private) java.lang.Object
toFieldSetType(java.lang.Object value)
-
Methods inherited from class com.google.protobuf.ExtensionLite
isLite
-
-
-
-
Field Detail
-
containingTypeDefaultInstance
final ContainingType extends MessageLite containingTypeDefaultInstance
-
defaultValue
final Type defaultValue
-
messageDefaultInstance
final MessageLite messageDefaultInstance
-
descriptor
final GeneratedMessageLite.ExtensionDescriptor descriptor
-
-
Constructor Detail
-
GeneratedExtension
GeneratedExtension(ContainingType containingTypeDefaultInstance, Type defaultValue, MessageLite messageDefaultInstance, GeneratedMessageLite.ExtensionDescriptor descriptor, java.lang.Class singularType)
Create a new instance with the given parameters.The last parameter
singularType
is only needed for enum types. We store integer values for enum types in aGeneratedMessageLite.ExtendableMessage
and use Java reflection to convert an integer value back into a concrete enum object.
-
-
Method Detail
-
getContainingTypeDefaultInstance
public ContainingType getContainingTypeDefaultInstance()
Default instance of the type being extended, used to identify that type.
-
getNumber
public int getNumber()
Get the field number.- Specified by:
getNumber
in classExtensionLite<ContainingType extends MessageLite,Type>
-
getMessageDefaultInstance
public MessageLite getMessageDefaultInstance()
If the extension is an embedded message or group, returns the default instance of the message.- Specified by:
getMessageDefaultInstance
in classExtensionLite<ContainingType extends MessageLite,Type>
-
fromFieldSetType
java.lang.Object fromFieldSetType(java.lang.Object value)
-
singularFromFieldSetType
java.lang.Object singularFromFieldSetType(java.lang.Object value)
-
toFieldSetType
java.lang.Object toFieldSetType(java.lang.Object value)
-
singularToFieldSetType
java.lang.Object singularToFieldSetType(java.lang.Object value)
-
getLiteType
public WireFormat.FieldType getLiteType()
Description copied from class:ExtensionLite
Returns the type of the field.- Specified by:
getLiteType
in classExtensionLite<ContainingType extends MessageLite,Type>
-
isRepeated
public boolean isRepeated()
Description copied from class:ExtensionLite
Returns whether it is a repeated field.- Specified by:
isRepeated
in classExtensionLite<ContainingType extends MessageLite,Type>
-
getDefaultValue
public Type getDefaultValue()
Description copied from class:ExtensionLite
Returns the default value of the extension field.- Specified by:
getDefaultValue
in classExtensionLite<ContainingType extends MessageLite,Type>
-
-