Go to the documentation of this file.
31 package com.google.protobuf;
36 import java.io.IOException;
37 import java.util.Collections;
39 import java.util.TreeMap;
62 super(keyType, defaultInstance.
key, valueType, defaultInstance.
value);
88 this.key = defaultKey;
89 this.value = defaultValue;
94 @SuppressWarnings(
"unchecked")
108 this.key = entry.getKey();
109 this.value = entry.getValue();
112 }
catch (IOException e) {
189 TreeMap<FieldDescriptor, Object> result =
new TreeMap<FieldDescriptor, Object>();
195 return Collections.unmodifiableMap(result);
200 throw new RuntimeException(
201 "Wrong FieldDescriptor \""
202 +
field.getFullName()
203 +
"\" used in message \""
204 +
metadata.descriptor.getFullName());
222 result =
field.getEnumType().findValueByNumberCreatingIfUnknown((
java.
lang.Integer) result);
229 throw new RuntimeException(
"There is no repeated field in a map entry message.");
234 throw new RuntimeException(
"There is no repeated field in a map entry message.");
284 this.hasValue =
true;
290 this.hasValue =
false;
315 throw new RuntimeException(
316 "Wrong FieldDescriptor \""
317 +
field.getFullName()
318 +
"\" used in message \""
319 +
metadata.descriptor.getFullName());
330 throw new RuntimeException(
"\"" +
field.getFullName() +
"\" is not a message value field.");
335 @SuppressWarnings(
"unchecked")
339 if (
field.getNumber() == 1) {
362 if (
field.getNumber() == 1) {
372 throw new RuntimeException(
"There is no repeated field in a map entry message.");
377 throw new RuntimeException(
"There is no repeated field in a map entry message.");
398 final TreeMap<FieldDescriptor, Object> result =
new TreeMap<FieldDescriptor, Object>();
404 return Collections.unmodifiableMap(result);
419 result =
field.getEnumType().findValueByNumberCreatingIfUnknown((Integer) result);
426 throw new RuntimeException(
"There is no repeated field in a map entry message.");
431 throw new RuntimeException(
"There is no repeated field in a map entry message.");
440 @SuppressWarnings(
"unchecked")
454 final Metadata<K, V> getMetadata() {
Builder< K, V > setKey(K key)
MapEntry< K, V > getDefaultInstanceForType()
Map.Entry< K, V > parseEntry(ByteString bytes, ExtensionRegistryLite extensionRegistry)
static UnknownFieldSet getDefaultInstance()
int getRepeatedFieldCount(FieldDescriptor field)
Builder< K, V > setUnknownFields(UnknownFieldSet unknownFields)
Metadata(Descriptor descriptor, MapEntry< K, V > defaultInstance, WireFormat.FieldType keyType, WireFormat.FieldType valueType)
volatile int cachedSerializedSize
final Metadata< K, V > metadata
Builder< K, V > clearValue()
Builder< K, V > newBuilderForType()
Builder(Metadata< K, V > metadata, K key, V value, boolean hasKey, boolean hasValue)
Object getRepeatedField(FieldDescriptor field, int index)
Builder< K, V > setField(FieldDescriptor field, Object value)
MapEntry(Descriptor descriptor, WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)
Map< FieldDescriptor, Object > getAllFields()
void checkFieldDescriptor(FieldDescriptor field)
final Parser< MapEntry< K, V > > parser
Builder< K, V > toBuilder()
MapEntry< K, V > getDefaultInstanceForType()
boolean hasField(FieldDescriptor field)
struct EnumValueDescriptor EnumValueDescriptor
Builder< K, V > clearKey()
static< V > boolean isInitialized(Metadata metadata, V value)
Parser< MapEntry< K, V > > getParserForType()
Map< FieldDescriptor, Object > getAllFields()
Builder(Metadata< K, V > metadata)
const FieldDescriptor * field
Builder< K, V > setValue(V value)
Builder< K, V > setRepeatedField(FieldDescriptor field, int index, Object value)
Object getField(FieldDescriptor field)
Object getRepeatedField(FieldDescriptor field, int index)
boolean hasField(FieldDescriptor field)
Builder< K, V > addRepeatedField(FieldDescriptor field, Object value)
InvalidProtocolBufferException setUnfinishedMessage(MessageLite unfinishedMessage)
static UninitializedMessageException newUninitializedMessageException(Message message)
MapEntry< K, V > buildPartial()
final Descriptor descriptor
Descriptor getDescriptorForType()
static< K, V > MapEntry< K, V > newDefaultInstance(Descriptor descriptor, WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)
Message.Builder newBuilderForField(FieldDescriptor field)
Descriptor getDescriptorForType()
UnknownFieldSet getUnknownFields()
Builder< K, V > clearField(FieldDescriptor field)
int getRepeatedFieldCount(FieldDescriptor field)
final Metadata< K, V > metadata
GLsizei const GLfloat * value
const upb_json_parsermethod const upb_symtab upb_sink * output
MapEntry(Metadata< K, V > metadata, CodedInputStream input, ExtensionRegistryLite extensionRegistry)
void checkFieldDescriptor(FieldDescriptor field)
UnknownFieldSet getUnknownFields()
void writeTo(CodedOutputStream output)
Object getField(FieldDescriptor field)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:56