public class MapEntryLite<K,V>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
MapEntryLite.Metadata<K,V> |
Modifier and Type | Field and Description |
---|---|
private K |
key |
private static int |
KEY_FIELD_NUMBER |
private MapEntryLite.Metadata<K,V> |
metadata |
private V |
value |
private static int |
VALUE_FIELD_NUMBER |
Modifier | Constructor and Description |
---|---|
private |
MapEntryLite(MapEntryLite.Metadata<K,V> metadata,
K key,
V value)
Creates a new MapEntryLite message.
|
private |
MapEntryLite(WireFormat.FieldType keyType,
K defaultKey,
WireFormat.FieldType valueType,
V defaultValue)
Creates a default MapEntryLite message instance.
|
Modifier and Type | Method and Description |
---|---|
int |
computeMessageSize(int fieldNumber,
K key,
V value)
Computes the message size for the provided key and value as though they were wrapped
by a
MapEntryLite . |
(package private) static <K,V> int |
computeSerializedSize(MapEntryLite.Metadata<K,V> metadata,
K key,
V value) |
K |
getKey() |
(package private) MapEntryLite.Metadata<K,V> |
getMetadata()
For experimental runtime internal use only.
|
V |
getValue() |
static <K,V> MapEntryLite<K,V> |
newDefaultInstance(WireFormat.FieldType keyType,
K defaultKey,
WireFormat.FieldType valueType,
V defaultValue)
Creates a default MapEntryLite message instance.
|
java.util.Map.Entry<K,V> |
parseEntry(ByteString bytes,
ExtensionRegistryLite extensionRegistry)
Parses an entry off of the input as a
Map.Entry . |
(package private) static <K,V> java.util.Map.Entry<K,V> |
parseEntry(CodedInputStream input,
MapEntryLite.Metadata<K,V> metadata,
ExtensionRegistryLite extensionRegistry) |
(package private) static <T> T |
parseField(CodedInputStream input,
ExtensionRegistryLite extensionRegistry,
WireFormat.FieldType type,
T value) |
void |
parseInto(MapFieldLite<K,V> map,
CodedInputStream input,
ExtensionRegistryLite extensionRegistry)
Parses an entry off of the input into the map.
|
void |
serializeTo(CodedOutputStream output,
int fieldNumber,
K key,
V value)
Serializes the provided key and value as though they were wrapped by a
MapEntryLite
to the output stream. |
(package private) static <K,V> void |
writeTo(CodedOutputStream output,
MapEntryLite.Metadata<K,V> metadata,
K key,
V value) |
private static final int KEY_FIELD_NUMBER
private static final int VALUE_FIELD_NUMBER
private final MapEntryLite.Metadata<K,V> metadata
private final K key
private final V value
private MapEntryLite(WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)
private MapEntryLite(MapEntryLite.Metadata<K,V> metadata, K key, V value)
public K getKey()
public V getValue()
public static <K,V> MapEntryLite<K,V> newDefaultInstance(WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)
static <K,V> void writeTo(CodedOutputStream output, MapEntryLite.Metadata<K,V> metadata, K key, V value) throws java.io.IOException
java.io.IOException
static <K,V> int computeSerializedSize(MapEntryLite.Metadata<K,V> metadata, K key, V value)
static <T> T parseField(CodedInputStream input, ExtensionRegistryLite extensionRegistry, WireFormat.FieldType type, T value) throws java.io.IOException
java.io.IOException
public void serializeTo(CodedOutputStream output, int fieldNumber, K key, V value) throws java.io.IOException
MapEntryLite
to the output stream. This helper method avoids allocation of a MapEntryLite
built with a key and value and is called from generated code directly.java.io.IOException
public int computeMessageSize(int fieldNumber, K key, V value)
MapEntryLite
. This helper method avoids allocation of a MapEntryLite
built with a key and value and is called from generated code directly.public java.util.Map.Entry<K,V> parseEntry(ByteString bytes, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
Map.Entry
. This helper requires an allocation
so using parseInto(com.google.protobuf.MapFieldLite<K, V>, com.google.protobuf.CodedInputStream, com.google.protobuf.ExtensionRegistryLite)
is preferred if possible.java.io.IOException
static <K,V> java.util.Map.Entry<K,V> parseEntry(CodedInputStream input, MapEntryLite.Metadata<K,V> metadata, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public void parseInto(MapFieldLite<K,V> map, CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
MapEntryLite
by parsing directly into the provided MapFieldLite
.java.io.IOException
MapEntryLite.Metadata<K,V> getMetadata()