K - the key typeV - the value typepublic class MapField<K,V> extends Object
Map to be used in generated API and also supports accessing
the field as a List to be used in reflection API. It keeps track of where the data is currently stored and do
necessary conversions between map and list.
This class is a protobuf implementation detail. Users shouldn't use this class directly.
THREAD-SAFETY NOTE: Read-only access is thread-safe. Users can call getMap() and getList() concurrently in multiple
threads. If write-access is needed, all access must be synchronized.| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
Clear.
|
MapField<K,V> |
copy()
Returns a deep copy of this MapField.
|
static <K,V> MapField<K,V> |
emptyMapField(MapEntry<K,V> defaultEntry)
Returns an immutable empty MapField.
|
boolean |
equals(Object object) |
Map<K,V> |
getMap()
Gets the map.
|
Map<K,V> |
getMutableMap()
Gets the mutable map.
|
int |
hashCode() |
void |
mergeFrom(MapField<K,V> other)
Merge from.
|
static <K,V> MapField<K,V> |
newMapField(MapEntry<K,V> defaultEntry)
Creates a new mutable empty MapField.
|
public static <K,V> MapField<K,V> emptyMapField(MapEntry<K,V> defaultEntry)
K - the key typeV - the value typedefaultEntry - the default entrypublic static <K,V> MapField<K,V> newMapField(MapEntry<K,V> defaultEntry)
K - the key typeV - the value typedefaultEntry - the default entrypublic void clear()
Copyright © 2022 Baidu, Inc.. All rights reserved.