Class MapFieldLite<K,V>

public final class MapFieldLite<K,V> extends LinkedHashMap<K,V>

Internal representation of map fields in generated lite-runtime messages.

This class is a protobuf implementation detail. Users shouldn't use this class directly.

Inheritance

Object > AbstractMap > java.util.HashMap > LinkedHashMap > MapFieldLite<K,V>

Type Parameters

NameDescription
K
V

Static Methods

<K,V>emptyMapField()

public static MapFieldLite<K,V> <K,V>emptyMapField()

Returns a singleton immutable empty MapFieldLite instance.

Returns
TypeDescription
MapFieldLite<K,V>

Methods

clear()

public void clear()
Overrides

entrySet()

public Set<Map.Entry<K,V>> entrySet()
Returns
TypeDescription
Set<Entry<K,V>>
Overrides

equals(Object object)

public boolean equals(Object object)

Checks whether two map fields are equal.

Parameter
NameDescription
objectObject
Returns
TypeDescription
boolean
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

isMutable()

public boolean isMutable()

Returns whether this field can be modified.

Returns
TypeDescription
boolean

makeImmutable()

public void makeImmutable()

Makes this field immutable. All subsequent modifications will throw an UnsupportedOperationException.

mergeFrom(MapFieldLite<K,V> other)

public void mergeFrom(MapFieldLite<K,V> other)
Parameter
NameDescription
otherMapFieldLite<K,V>

mutableCopy()

public MapFieldLite<K,V> mutableCopy()

Returns a deep copy of this map field.

Returns
TypeDescription
MapFieldLite<K,V>

put(K key, V value)

public V put(K key, V value)
Parameters
NameDescription
keyK
valueV
Returns
TypeDescription
V
Overrides

put(Map.Entry<K,V> entry)

public V put(Map.Entry<K,V> entry)
Parameter
NameDescription
entryEntry<K,V>
Returns
TypeDescription
V

putAll(Map<? extends K,? extends V> m)

public void putAll(Map<? extends K,? extends V> m)
Parameter
NameDescription
mMap<? extends K,? extends V>
Overrides

remove(Object key)

public V remove(Object key)
Parameter
NameDescription
keyObject
Returns
TypeDescription
V
Overrides