Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
com.google.protobuf.MapEntry< K, V > Class Template Reference
Inheritance diagram for com.google.protobuf.MapEntry< K, V >:
Inheritance graph
[legend]

Classes

class  Builder
 
class  Metadata
 

Public Member Functions

Map< FieldDescriptor, Object > getAllFields ()
 
MapEntry< K, V > getDefaultInstanceForType ()
 
Descriptor getDescriptorForType ()
 
Object getField (FieldDescriptor field)
 
K getKey ()
 
Parser< MapEntry< K, V > > getParserForType ()
 
Object getRepeatedField (FieldDescriptor field, int index)
 
int getRepeatedFieldCount (FieldDescriptor field)
 
int getSerializedSize ()
 
UnknownFieldSet getUnknownFields ()
 
getValue ()
 
boolean hasField (FieldDescriptor field)
 
boolean isInitialized ()
 
Builder< K, V > newBuilderForType ()
 
Builder< K, V > toBuilder ()
 
void writeTo (CodedOutputStream output) throws IOException
 
- Public Member Functions inherited from com.google.protobuf.AbstractMessage
boolean equals (final Object other)
 
List< String > findInitializationErrors ()
 
String getInitializationErrorString ()
 
FieldDescriptor getOneofFieldDescriptor (OneofDescriptor oneof)
 
int hashCode ()
 
boolean hasOneof (OneofDescriptor oneof)
 
final String toString ()
 
- Public Member Functions inherited from com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType >
byte[] toByteArray ()
 
ByteString toByteString ()
 
void writeDelimitedTo (final OutputStream output) throws IOException
 
void writeTo (final OutputStream output) throws IOException
 
- Public Member Functions inherited from com.google.protobuf.MessageOrBuilder
Object getField (Descriptors.FieldDescriptor field)
 
Descriptors.FieldDescriptor getOneofFieldDescriptor (Descriptors.OneofDescriptor oneof)
 
Object getRepeatedField (Descriptors.FieldDescriptor field, int index)
 
int getRepeatedFieldCount (Descriptors.FieldDescriptor field)
 
boolean hasField (Descriptors.FieldDescriptor field)
 
boolean hasOneof (Descriptors.OneofDescriptor oneof)
 

Static Public Member Functions

static< K, V > MapEntry< K, V > newDefaultInstance (Descriptor descriptor, WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)
 

Private Member Functions

void checkFieldDescriptor (FieldDescriptor field)
 
 MapEntry (Descriptor descriptor, WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)
 
 MapEntry (Metadata metadata, K key, V value)
 
 MapEntry (Metadata< K, V > metadata, CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
 

Static Private Member Functions

static< V > boolean isInitialized (Metadata metadata, V value)
 

Private Attributes

volatile int cachedSerializedSize = -1
 
final K key
 
final Metadata< K, V > metadata
 
final V value
 

Additional Inherited Members

- Protected Member Functions inherited from com.google.protobuf.AbstractMessage
Message.Builder newBuilderForType (BuilderParent parent)
 
- Static Protected Member Functions inherited from com.google.protobuf.AbstractMessage
static int hashBoolean (boolean b)
 
static int hashEnum (EnumLite e)
 
static int hashEnumList (List<? extends EnumLite > list)
 
static int hashFields (int hash, Map< FieldDescriptor, Object > map)
 
static int hashLong (long n)
 
- Static Protected Member Functions inherited from com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType >
static< T > void addAll (final Iterable< T > values, final Collection<? super T > list)
 
static< T > void addAll (final Iterable< T > values, final List<? super T > list)
 
static void checkByteStringIsUtf8 (ByteString byteString) throws IllegalArgumentException
 
- Protected Attributes inherited from com.google.protobuf.AbstractMessage
int memoizedSize = -1
 
- Protected Attributes inherited from com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType >
int memoizedHashCode = 0
 

Detailed Description

Implements MapEntry messages.

In reflection API, map fields will be treated as repeated message fields and each map entry is accessed as a message. This MapEntry class is used to represent these map entry messages in reflection API.

Protobuf internal. Users shouldn't use this class.

Definition at line 50 of file MapEntry.java.

Constructor & Destructor Documentation

◆ MapEntry() [1/3]

com.google.protobuf.MapEntry< K, V >.MapEntry ( Descriptor  descriptor,
WireFormat.FieldType  keyType,
K  defaultKey,
WireFormat.FieldType  valueType,
defaultValue 
)
inlineprivate

Create a default MapEntry instance.

Definition at line 82 of file MapEntry.java.

◆ MapEntry() [2/3]

com.google.protobuf.MapEntry< K, V >.MapEntry ( Metadata  metadata,
K  key,
value 
)
inlineprivate

Create a MapEntry with the provided key and value.

Definition at line 95 of file MapEntry.java.

◆ MapEntry() [3/3]

com.google.protobuf.MapEntry< K, V >.MapEntry ( Metadata< K, V >  metadata,
CodedInputStream  input,
ExtensionRegistryLite  extensionRegistry 
) throws InvalidProtocolBufferException
inlineprivate

Parsing constructor.

Definition at line 102 of file MapEntry.java.

Member Function Documentation

◆ checkFieldDescriptor()

void com.google.protobuf.MapEntry< K, V >.checkFieldDescriptor ( FieldDescriptor  field)
inlineprivate

Definition at line 198 of file MapEntry.java.

◆ getAllFields()

Map<FieldDescriptor, Object> com.google.protobuf.MapEntry< K, V >.getAllFields ( )
inline

Returns a collection of all the fields in this message which are set and their corresponding values. A singular ("required" or "optional") field is set iff hasField() returns true for that field. A "repeated" field is set iff getRepeatedFieldCount() is greater than zero. The values are exactly what would be returned by calling getField(Descriptors.FieldDescriptor) for each field. The map is guaranteed to be a sorted map, so iterating over it will return fields in order by field number.
If this is for a builder, the returned map may or may not reflect future changes to the builder. Either way, the returned map is itself unmodifiable.

Implements com.google.protobuf.MessageOrBuilder.

Definition at line 188 of file MapEntry.java.

◆ getDefaultInstanceForType()

MapEntry<K, V> com.google.protobuf.MapEntry< K, V >.getDefaultInstanceForType ( )
inline

Get an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from the

getDefaultInstance()

method of generated message classes in that this method is an abstract method of the

MessageLite

interface whereas

getDefaultInstance()

is a static method of a specific class. They return the same thing.

Implements com.google.protobuf.MessageOrBuilder.

Definition at line 178 of file MapEntry.java.

◆ getDescriptorForType()

Descriptor com.google.protobuf.MapEntry< K, V >.getDescriptorForType ( )
inline

Get the message's type's descriptor. This differs from the

getDescriptor()

method of generated message classes in that this method is an abstract method of the

Message

interface whereas

getDescriptor()

is a static method of a specific class. They return the same thing.

Implements com.google.protobuf.MessageOrBuilder.

Definition at line 183 of file MapEntry.java.

◆ getField()

Object com.google.protobuf.MapEntry< K, V >.getField ( FieldDescriptor  field)
inline

Definition at line 217 of file MapEntry.java.

◆ getKey()

K com.google.protobuf.MapEntry< K, V >.getKey ( )
inline

Definition at line 131 of file MapEntry.java.

◆ getParserForType()

Parser<MapEntry<K, V> > com.google.protobuf.MapEntry< K, V >.getParserForType ( )
inline

Gets the parser for a message of the same type as this message.

Implements com.google.protobuf.Message.

Definition at line 163 of file MapEntry.java.

◆ getRepeatedField()

Object com.google.protobuf.MapEntry< K, V >.getRepeatedField ( FieldDescriptor  field,
int  index 
)
inline

Definition at line 233 of file MapEntry.java.

◆ getRepeatedFieldCount()

int com.google.protobuf.MapEntry< K, V >.getRepeatedFieldCount ( FieldDescriptor  field)
inline

Definition at line 228 of file MapEntry.java.

◆ getSerializedSize()

int com.google.protobuf.MapEntry< K, V >.getSerializedSize ( )
inline

Get the number of bytes required to encode this message. The result is only computed on the first call and memoized after that.

Reimplemented from com.google.protobuf.AbstractMessage.

Definition at line 142 of file MapEntry.java.

◆ getUnknownFields()

UnknownFieldSet com.google.protobuf.MapEntry< K, V >.getUnknownFields ( )
inline

Get the UnknownFieldSet for this message.

Implements com.google.protobuf.MessageOrBuilder.

Definition at line 238 of file MapEntry.java.

◆ getValue()

V com.google.protobuf.MapEntry< K, V >.getValue ( )
inline

Definition at line 135 of file MapEntry.java.

◆ hasField()

boolean com.google.protobuf.MapEntry< K, V >.hasField ( FieldDescriptor  field)
inline

Definition at line 209 of file MapEntry.java.

◆ isInitialized() [1/2]

boolean com.google.protobuf.MapEntry< K, V >.isInitialized ( )
inline

Returns true if all required fields in the message and all embedded messages are set, false otherwise.

See also: MessageOrBuilder#getInitializationErrorString()

Reimplemented from com.google.protobuf.AbstractMessage.

Definition at line 158 of file MapEntry.java.

◆ isInitialized() [2/2]

static <V> boolean com.google.protobuf.MapEntry< K, V >.isInitialized ( Metadata  metadata,
value 
)
inlinestaticprivate

Definition at line 446 of file MapEntry.java.

◆ newBuilderForType()

Builder<K, V> com.google.protobuf.MapEntry< K, V >.newBuilderForType ( )
inline

Constructs a new builder for a message of the same type as this message.

Implements com.google.protobuf.Message.

Definition at line 168 of file MapEntry.java.

◆ newDefaultInstance()

static <K, V> MapEntry<K, V> com.google.protobuf.MapEntry< K, V >.newDefaultInstance ( Descriptor  descriptor,
WireFormat.FieldType  keyType,
K  defaultKey,
WireFormat.FieldType  valueType,
defaultValue 
)
inlinestatic

Create a default MapEntry instance. A default MapEntry instance should be created only once for each map entry message type. Generated code should store the created default instance and use it later to create new MapEntry messages of the same type.

Definition at line 122 of file MapEntry.java.

◆ toBuilder()

Builder<K, V> com.google.protobuf.MapEntry< K, V >.toBuilder ( )
inline

Constructs a builder initialized with the current message. Use this to derive a new message from the current one.

Implements com.google.protobuf.Message.

Definition at line 173 of file MapEntry.java.

◆ writeTo()

void com.google.protobuf.MapEntry< K, V >.writeTo ( CodedOutputStream  output) throws IOException
inline

Serializes the message and writes it to

. This does not flush or close the stream.

Reimplemented from com.google.protobuf.AbstractMessage.

Definition at line 153 of file MapEntry.java.

Member Data Documentation

◆ cachedSerializedSize

volatile int com.google.protobuf.MapEntry< K, V >.cachedSerializedSize = -1
private

Definition at line 139 of file MapEntry.java.

◆ key

final K com.google.protobuf.MapEntry< K, V >.key
private

Definition at line 77 of file MapEntry.java.

◆ metadata

final Metadata<K, V> com.google.protobuf.MapEntry< K, V >.metadata
private

Definition at line 79 of file MapEntry.java.

◆ value

final V com.google.protobuf.MapEntry< K, V >.value
private

Definition at line 78 of file MapEntry.java.


The documentation for this class was generated from the following file:
output
const upb_json_parsermethod const upb_symtab upb_sink * output
Definition: ruby/ext/google/protobuf_c/upb.h:10503


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