public static class GeneratedMessage.GeneratedExtension<ContainingType extends Message,Type> extends Extension<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 GeneratedMessageLite.ExtendableMessage and GeneratedMessage.ExtendableBuilder.
Extension.MessageType| Modifier and Type | Method and Description |
|---|---|
Type |
getDefaultValue()
Returns the default value of the extension field.
|
Descriptors.FieldDescriptor |
getDescriptor()
Returns the descriptor of the extension.
|
WireFormat.FieldType |
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.FieldDescriptor descriptor)
For use by generated code only.
|
boolean |
isRepeated()
Returns whether it is a repeated field.
|
getMessageTypepublic void internalInit(Descriptors.FieldDescriptor descriptor)
public Descriptors.FieldDescriptor getDescriptor()
ExtensiongetDescriptor in class Extension<ContainingType extends Message,Type>public Message getMessageDefaultInstance()
getMessageDefaultInstance in class ExtensionLite<ContainingType extends Message,Type>public int getNumber()
ExtensionLitegetNumber in class ExtensionLite<ContainingType extends Message,Type>public WireFormat.FieldType getLiteType()
ExtensionLitegetLiteType in class ExtensionLite<ContainingType extends Message,Type>public boolean isRepeated()
ExtensionLiteisRepeated in class ExtensionLite<ContainingType extends Message,Type>public Type getDefaultValue()
ExtensionLitegetDefaultValue in class ExtensionLite<ContainingType extends Message,Type>