Top Description Inners Fields Constructors Methods
com.google.protobuf

public Class MapEntryLite<K, V>

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.AbstractMap, .Map

Implements the lite version of map entry messages.

This class serves as an utility class to help do serialization/parsing of map entries. It's used in generated code and also in the full version MapEntry message.

Protobuf internal. Users shouldn't use.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final K
private static final int
private final MapEntryLite.Metadata<K, V>
private final V
private static final int

Constructor Summary

AccessConstructor and Description
private
MapEntryLite(WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)

Creates a default MapEntryLite message instance.

private
MapEntryLite(MapEntryLite.Metadata<K, V> metadata, K key, V value)

Creates a new MapEntryLite message.

Method Summary

Modifier and TypeMethod and Description
public 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.

pack-priv static <K, V> int
computeSerializedSize(MapEntryLite.Metadata<K, V> metadata, K key, V value)

public K
pack-priv MapEntryLite.Metadata<K, V>
getMetadata()

For experimental runtime internal use only.

public V
public static <K, V> MapEntryLite<K, V>
newDefaultInstance(WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)

Creates a default MapEntryLite message instance.

public Map.Entry<K, V>
parseEntry(ByteString bytes, ExtensionRegistryLite extensionRegistry)

Parses an entry off of the input as a Map.Entry.

pack-priv static <K, V> Map.Entry<K, V>
parseEntry(CodedInputStream input, MapEntryLite.Metadata<K, V> metadata, ExtensionRegistryLite extensionRegistry)

pack-priv static <T> T
parseField(CodedInputStream input, ExtensionRegistryLite extensionRegistry, WireFormat.FieldType type, T value)

public void
parseInto(MapFieldLite<K, V> map, CodedInputStream input, ExtensionRegistryLite extensionRegistry)

Parses an entry off of the input into the map.

public 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.

pack-priv static <K, V> void
writeTo(CodedOutputStream output, MapEntryLite.Metadata<K, V> metadata, K key, V value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private final K key
KEY_FIELD_NUMBERback to summary
private static final int KEY_FIELD_NUMBER
metadataback to summary
private final MapEntryLite.Metadata<K, V> metadata
valueback to summary
private final V value
VALUE_FIELD_NUMBERback to summary
private static final int VALUE_FIELD_NUMBER

Constructor Detail

MapEntryLiteback to summary
private MapEntryLite(WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)

Creates a default MapEntryLite message instance.

MapEntryLiteback to summary
private MapEntryLite(MapEntryLite.Metadata<K, V> metadata, K key, V value)

Creates a new MapEntryLite message.

Method Detail

computeMessageSizeback to summary
public 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. This helper method avoids allocation of a MapEntryLite built with a key and value and is called from generated code directly.

computeSerializedSizeback to summary
pack-priv static <K, V> int computeSerializedSize(MapEntryLite.Metadata<K, V> metadata, K key, V value)
getKeyback to summary
public K getKey()
getMetadataback to summary
pack-priv MapEntryLite.Metadata<K, V> getMetadata()

For experimental runtime internal use only.

getValueback to summary
public V getValue()
newDefaultInstanceback to summary
public static <K, V> MapEntryLite<K, V> newDefaultInstance(WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)

Creates a default MapEntryLite message instance.

This method is used by generated code to create the default instance for a map entry message. The created default instance should be used to create new map entry messages of the same type. For each map entry message, only one default instance should be created.

parseEntryback to summary
public Map.Entry<K, V> parseEntry(ByteString bytes, ExtensionRegistryLite extensionRegistry) throws IOException

Parses an entry off of the input as a Map.Entry. This helper requires an allocation so using parseInto is preferred if possible.

parseEntryback to summary
pack-priv static <K, V> Map.Entry<K, V> parseEntry(CodedInputStream input, MapEntryLite.Metadata<K, V> metadata, ExtensionRegistryLite extensionRegistry) throws IOException
parseFieldback to summary
pack-priv static <T> T parseField(CodedInputStream input, ExtensionRegistryLite extensionRegistry, WireFormat.FieldType type, T value) throws IOException
Annotations
@SuppressWarnings:unchecked
parseIntoback to summary
public void parseInto(MapFieldLite<K, V> map, CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException

Parses an entry off of the input into the map. This helper avoids allocaton of a MapEntryLite by parsing directly into the provided MapFieldLite.

serializeToback to summary
public void serializeTo(CodedOutputStream output, int fieldNumber, K key, V value) throws IOException

Serializes the provided key and value as though they were wrapped by a 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.

writeToback to summary
pack-priv static <K, V> void writeTo(CodedOutputStream output, MapEntryLite.Metadata<K, V> metadata, K key, V value) throws IOException
com.google.protobuf back to summary

pack-priv Class MapEntryLite.Metadata<K, V>

extends Object
Class Inheritance
Known Direct Subclasses
com.google.protobuf.MapEntry.Metadata

Field Summary

Modifier and TypeField and Description
public final K
public final V
public final WireFormat.FieldType
public final WireFormat.FieldType

Constructor Summary

AccessConstructor and Description
public
Metadata(WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultKeyback to summary
public final K defaultKey
defaultValueback to summary
public final V defaultValue
keyTypeback to summary
public final WireFormat.FieldType keyType
valueTypeback to summary
public final WireFormat.FieldType valueType

Constructor Detail

Metadataback to summary
public Metadata(WireFormat.FieldType keyType, K defaultKey, WireFormat.FieldType valueType, V defaultValue)