public static class GeneratedMessage.GeneratedExtension<ContainingType extends Messageextends Extension ,Type> <ContainingType ,Type>
For example, imagine you have the .proto file:
option java_class = "MyProto";
message Foo {
extensions 1000 to max;
}
extend Foo {
optional int32 bar;
}
Then, MyProto.Foo.bar has type GeneratedExtension<MyProto.Foo, Integer>.
In general, users should ignore the details of this type, and simply use these static singletons as parameters to the extension accessors defined in GeneratedMessage.ExtendableMessage and GeneratedMessage.ExtendableBuilder.
Extension.ExtensionType , Extension.MessageType | Modifier and Type | Method and Description |
|---|---|
protected Object |
fromReflectionType(Object
Convert from the type used by the reflection accessors to the type used by native accessors.
|
Type |
getDefaultValue()
Returns the default value of the extension field.
|
Descriptors |
getDescriptor()
Returns the descriptor of the extension.
|
protected Extension |
getExtensionType()
|
WireFormat |
getLiteType()
Returns the type of the field.
|
Message |
getMessageDefaultInstance()
If the extension is an embedded message or group, returns the default instance of the message.
|
int |
getNumber()
Returns the field number of the extension.
|
void |
internalInit(Descriptors
For use by generated code only.
|
boolean |
isRepeated()
Returns whether it is a repeated field.
|
protected Object |
singularFromReflectionType(Object
Like
fromReflectionType(Object), but if the type is a repeated type, this converts a single element.
|
protected Object |
singularToReflectionType(Object
Like
toReflectionType(Object), but if the type is a repeated type, this converts a single element.
|
protected Object |
toReflectionType(Object
Convert from the type used by the native accessors to the type used by reflection accessors.
|
getMessageTypepublic void internalInit(Descriptors.FieldDescriptor descriptor)
public Descriptors.FieldDescriptor getDescriptor()
Extension
public MessagegetMessageDefaultInstance()
protected Extension.ExtensionType getExtensionType()
protected ObjectfromReflectionType(Object value)
protected ObjectsingularFromReflectionType(Object value)
fromReflectionType(Object), but if the type is a repeated type, this converts a single element.
protected ObjecttoReflectionType(Object value)
protected ObjectsingularToReflectionType(Object value)
toReflectionType(Object), but if the type is a repeated type, this converts a single element.
public int getNumber()
Extension
public WireFormat.FieldType getLiteType()
Extension
public boolean isRepeated()
Extension