Public Member Functions | Protected Member Functions | Private Attributes | List of all members
com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type > Class Template Reference
Inheritance diagram for com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >:
Inheritance graph
[legend]

Public Member Functions

Type getDefaultValue ()
 
FieldDescriptor getDescriptor ()
 
WireFormat.FieldType getLiteType ()
 
Message getMessageDefaultInstance ()
 
int getNumber ()
 
void internalInit (final FieldDescriptor descriptor)
 
boolean isRepeated ()
 
- Public Member Functions inherited from com.google.protobuf.Extension< ContainingType, Type >
abstract Descriptors.FieldDescriptor getDescriptor ()
 
abstract Message getMessageDefaultInstance ()
 
MessageType getMessageType ()
 

Protected Member Functions

Object fromReflectionType (final Object value)
 
ExtensionType getExtensionType ()
 
Object singularFromReflectionType (final Object value)
 
Object singularToReflectionType (final Object value)
 
Object toReflectionType (final Object value)
 
- Protected Member Functions inherited from com.google.protobuf.Extension< ContainingType, Type >
abstract Object fromReflectionType (Object value)
 
abstract ExtensionType getExtensionType ()
 
abstract Object singularFromReflectionType (Object value)
 
abstract Object singularToReflectionType (Object value)
 
abstract Object toReflectionType (Object value)
 

Private Attributes

ExtensionDescriptorRetriever descriptorRetriever
 
final Method enumGetValueDescriptor
 
final Method enumValueOf
 
final ExtensionType extensionType
 
final Message messageDefaultInstance
 
final Class singularType
 

Detailed Description

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 ExtendableMessage and ExtendableBuilder.

Definition at line 1757 of file GeneratedMessage.java.

Member Function Documentation

◆ fromReflectionType()

Object com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.fromReflectionType ( final Object  value)
inlineprotected

Convert from the type used by the reflection accessors to the type used by native accessors. E.g., for enums, the reflection accessors use EnumValueDescriptors but the native accessors use the generated enum type.

Definition at line 1852 of file GeneratedMessage.java.

◆ getDefaultValue()

Type com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.getDefaultValue ( )
inline

Definition at line 1951 of file GeneratedMessage.java.

◆ getDescriptor()

FieldDescriptor com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.getDescriptor ( )
inline

Definition at line 1822 of file GeneratedMessage.java.

◆ getExtensionType()

ExtensionType com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.getExtensionType ( )
inlineprotected

Definition at line 1840 of file GeneratedMessage.java.

◆ getLiteType()

WireFormat.FieldType com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.getLiteType ( )
inline

Definition at line 1940 of file GeneratedMessage.java.

◆ getMessageDefaultInstance()

Message com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.getMessageDefaultInstance ( )
inline

If the extension is an embedded message or group, returns the default instance of the message.

Definition at line 1835 of file GeneratedMessage.java.

◆ getNumber()

int com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.getNumber ( )
inline

Definition at line 1935 of file GeneratedMessage.java.

◆ internalInit()

void com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.internalInit ( final FieldDescriptor  descriptor)
inline

For use by generated code only.

Definition at line 1801 of file GeneratedMessage.java.

◆ isRepeated()

boolean com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.isRepeated ( )
inline

Definition at line 1945 of file GeneratedMessage.java.

◆ singularFromReflectionType()

Object com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.singularFromReflectionType ( final Object  value)
inlineprotected

Like fromReflectionType(Object), but if the type is a repeated type, this converts a single element.

Definition at line 1876 of file GeneratedMessage.java.

◆ singularToReflectionType()

Object com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.singularToReflectionType ( final Object  value)
inlineprotected

Like toReflectionType(Object), but if the type is a repeated type, this converts a single element.

Definition at line 1924 of file GeneratedMessage.java.

◆ toReflectionType()

Object com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.toReflectionType ( final Object  value)
inlineprotected

Convert from the type used by the native accessors to the type used by reflection accessors. E.g., for enums, the reflection accessors use EnumValueDescriptors but the native accessors use the generated enum type.

Definition at line 1901 of file GeneratedMessage.java.

Member Data Documentation

◆ descriptorRetriever

ExtensionDescriptorRetriever com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.descriptorRetriever
private

Definition at line 1814 of file GeneratedMessage.java.

◆ enumGetValueDescriptor

final Method com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.enumGetValueDescriptor
private

Definition at line 1818 of file GeneratedMessage.java.

◆ enumValueOf

final Method com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.enumValueOf
private

Definition at line 1817 of file GeneratedMessage.java.

◆ extensionType

final ExtensionType com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.extensionType
private

Definition at line 1819 of file GeneratedMessage.java.

◆ messageDefaultInstance

final Message com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.messageDefaultInstance
private

Definition at line 1816 of file GeneratedMessage.java.

◆ singularType

final Class com.google.protobuf.GeneratedMessage.GeneratedExtension< ContainingType extends Message, Type >.singularType
private

Definition at line 1815 of file GeneratedMessage.java.


The documentation for this class was generated from the following file:


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:07