public static class GeneratedMessageLite.GeneratedExtension<ContainingType extends MessageLite,Type> extends ExtensionLite<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 GeneratedMessageLite.ExtendableBuilder.
| Modifier and Type | Method and Description |
|---|---|
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.
|
public ContainingType getContainingTypeDefaultInstance()
public Type getDefaultValue()
ExtensionLitegetDefaultValue in class ExtensionLite<ContainingType extends MessageLite,Type>public WireFormat.FieldType getLiteType()
ExtensionLitegetLiteType in class ExtensionLite<ContainingType extends MessageLite,Type>public MessageLite getMessageDefaultInstance()
getMessageDefaultInstance in class ExtensionLite<ContainingType extends MessageLite,Type>public int getNumber()
getNumber in class ExtensionLite<ContainingType extends MessageLite,Type>public boolean isRepeated()
ExtensionLiteisRepeated in class ExtensionLite<ContainingType extends MessageLite,Type>