public static class GeneratedMessageLite.GeneratedExtension<ContainingType extends MessageLite,Type> extends ExtensionLite<ContainingType,Type>
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().Modifier and Type | Field and Description |
---|---|
(package private) ContainingType |
containingTypeDefaultInstance |
(package private) Type |
defaultValue |
(package private) GeneratedMessageLite.ExtensionDescriptor |
descriptor |
(package private) MessageLite |
messageDefaultInstance |
Constructor and Description |
---|
GeneratedExtension(ContainingType containingTypeDefaultInstance,
Type defaultValue,
MessageLite messageDefaultInstance,
GeneratedMessageLite.ExtensionDescriptor descriptor,
java.lang.Class singularType)
Create a new instance with the given parameters.
|
Modifier and Type | Method and 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) |
isLite
final ContainingType extends MessageLite containingTypeDefaultInstance
final Type defaultValue
final MessageLite messageDefaultInstance
final GeneratedMessageLite.ExtensionDescriptor descriptor
GeneratedExtension(ContainingType containingTypeDefaultInstance, Type defaultValue, MessageLite messageDefaultInstance, GeneratedMessageLite.ExtensionDescriptor descriptor, java.lang.Class singularType)
singularType
is only needed for enum types.
We store integer values for enum types in a GeneratedMessageLite.ExtendableMessage
and use Java reflection to convert an integer value back into a concrete
enum object.public ContainingType getContainingTypeDefaultInstance()
public int getNumber()
getNumber
in class ExtensionLite<ContainingType extends MessageLite,Type>
public MessageLite getMessageDefaultInstance()
getMessageDefaultInstance
in class ExtensionLite<ContainingType extends MessageLite,Type>
java.lang.Object fromFieldSetType(java.lang.Object value)
java.lang.Object singularFromFieldSetType(java.lang.Object value)
java.lang.Object toFieldSetType(java.lang.Object value)
java.lang.Object singularToFieldSetType(java.lang.Object value)
public WireFormat.FieldType getLiteType()
ExtensionLite
getLiteType
in class ExtensionLite<ContainingType extends MessageLite,Type>
public boolean isRepeated()
ExtensionLite
isRepeated
in class ExtensionLite<ContainingType extends MessageLite,Type>
public Type getDefaultValue()
ExtensionLite
getDefaultValue
in class ExtensionLite<ContainingType extends MessageLite,Type>