public final class MapEntry<K,V> extends AbstractMessage
| Modifier and Type | Class and Description |
|---|---|
static class |
MapEntry.Builder<K,V>
Builder to create
MapEntry messages. |
AbstractMessage.BuilderParentmemoizedSizememoizedHashCode| Modifier and Type | Method and Description |
|---|---|
java.util.Map<Descriptors.FieldDescriptor,java.lang.Object> |
getAllFields()
Returns a collection of all the fields in this message which are set
and their corresponding values.
|
MapEntry<K,V> |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
Descriptors.Descriptor |
getDescriptorForType()
Get the message's type's descriptor.
|
java.lang.Object |
getField(Descriptors.FieldDescriptor field)
Obtains the value of the given field, or the default value if it is
not set.
|
K |
getKey() |
Parser<MapEntry<K,V>> |
getParserForType()
Gets the parser for a message of the same type as this message.
|
java.lang.Object |
getRepeatedField(Descriptors.FieldDescriptor field,
int index)
Gets an element of a repeated field.
|
int |
getRepeatedFieldCount(Descriptors.FieldDescriptor field)
Gets the number of elements of a repeated field.
|
int |
getSerializedSize()
Get the number of bytes required to encode this message.
|
UnknownFieldSet |
getUnknownFields()
Get the
UnknownFieldSet for this message. |
V |
getValue() |
boolean |
hasField(Descriptors.FieldDescriptor field)
Returns true if the given field is set.
|
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded
messages are set, false otherwise.
|
MapEntry.Builder<K,V> |
newBuilderForType()
Constructs a new builder for a message of the same type as this message.
|
static <K,V> MapEntry<K,V> |
newDefaultInstance(Descriptors.Descriptor descriptor,
WireFormat.FieldType keyType,
K defaultKey,
WireFormat.FieldType valueType,
V defaultValue)
Create a default MapEntry instance.
|
MapEntry.Builder<K,V> |
toBuilder()
Constructs a builder initialized with the current message.
|
void |
writeTo(CodedOutputStream output)
Serializes the message and writes it to
output. |
equals, findInitializationErrors, getInitializationErrorString, getOneofFieldDescriptor, hashBoolean, hashCode, hashEnum, hashEnumList, hashFields, hashLong, hasOneof, newBuilderForType, toStringaddAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waittoByteArray, toByteString, writeDelimitedTo, writeTopublic static <K,V> MapEntry<K,V> newDefaultInstance(Descriptors.Descriptor descriptor, WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)
public K getKey()
public V getValue()
public int getSerializedSize()
MessageLitegetSerializedSize in interface MessageLitegetSerializedSize in class AbstractMessagepublic void writeTo(CodedOutputStream output) throws java.io.IOException
MessageLiteoutput. This does not
flush or close the stream.writeTo in interface MessageLitewriteTo in class AbstractMessagejava.io.IOExceptionpublic boolean isInitialized()
MessageLiteOrBuilderisInitialized in interface MessageLiteOrBuilderisInitialized in class AbstractMessagepublic Parser<MapEntry<K,V>> getParserForType()
MessageLitepublic MapEntry.Builder<K,V> newBuilderForType()
MessageLitepublic MapEntry.Builder<K,V> toBuilder()
MessageLitepublic MapEntry<K,V> getDefaultInstanceForType()
MessageLiteOrBuildergetDefaultInstance() 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.public Descriptors.Descriptor getDescriptorForType()
MessageOrBuildergetDescriptor() 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.public java.util.Map<Descriptors.FieldDescriptor,java.lang.Object> getAllFields()
MessageOrBuilderMessageOrBuilder.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.
public boolean hasField(Descriptors.FieldDescriptor field)
MessageOrBuilderpublic java.lang.Object getField(Descriptors.FieldDescriptor field)
MessageOrBuilderpublic int getRepeatedFieldCount(Descriptors.FieldDescriptor field)
MessageOrBuilderpublic java.lang.Object getRepeatedField(Descriptors.FieldDescriptor field, int index)
MessageOrBuilderpublic UnknownFieldSet getUnknownFields()
MessageOrBuilderUnknownFieldSet for this message.