|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.protobuf.Extension<ContainingType,Type>
com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingType,Type>
public static class GeneratedMessage.GeneratedExtension<ContainingType extends Message,Type>
Type used to represent generated extensions. The protocol compiler generates a static singleton instance of this class for each extension.
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
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.protobuf.Extension |
---|
Extension.ExtensionType, Extension.MessageType |
Method Summary | |
---|---|
protected java.lang.Object |
fromReflectionType(java.lang.Object value)
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.FieldDescriptor |
getDescriptor()
Returns the descriptor of the extension. |
protected Extension.ExtensionType |
getExtensionType()
|
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. |
protected java.lang.Object |
singularFromReflectionType(java.lang.Object value)
Like fromReflectionType(Object) , but if the type is a repeated
type, this converts a single element. |
protected java.lang.Object |
singularToReflectionType(java.lang.Object value)
Like toReflectionType(Object) , but if the type is a repeated
type, this converts a single element. |
protected java.lang.Object |
toReflectionType(java.lang.Object value)
Convert from the type used by the native accessors to the type used by reflection accessors. |
Methods inherited from class com.google.protobuf.Extension |
---|
getMessageType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void internalInit(Descriptors.FieldDescriptor descriptor)
public Descriptors.FieldDescriptor getDescriptor()
Extension
getDescriptor
in class Extension<ContainingType extends Message,Type>
public Message getMessageDefaultInstance()
getMessageDefaultInstance
in class Extension<ContainingType extends Message,Type>
protected Extension.ExtensionType getExtensionType()
getExtensionType
in class Extension<ContainingType extends Message,Type>
protected java.lang.Object fromReflectionType(java.lang.Object value)
fromReflectionType
in class Extension<ContainingType extends Message,Type>
protected java.lang.Object singularFromReflectionType(java.lang.Object value)
fromReflectionType(Object)
, but if the type is a repeated
type, this converts a single element.
singularFromReflectionType
in class Extension<ContainingType extends Message,Type>
protected java.lang.Object toReflectionType(java.lang.Object value)
toReflectionType
in class Extension<ContainingType extends Message,Type>
protected java.lang.Object singularToReflectionType(java.lang.Object value)
toReflectionType(Object)
, but if the type is a repeated
type, this converts a single element.
singularToReflectionType
in class Extension<ContainingType extends Message,Type>
public int getNumber()
Extension
getNumber
in class Extension<ContainingType extends Message,Type>
public WireFormat.FieldType getLiteType()
Extension
getLiteType
in class Extension<ContainingType extends Message,Type>
public boolean isRepeated()
Extension
isRepeated
in class Extension<ContainingType extends Message,Type>
public Type getDefaultValue()
Extension
getDefaultValue
in class Extension<ContainingType extends Message,Type>
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |