类 MapField<K,V>
java.lang.Object
com.baidu.bjf.remoting.protobuf.MapField<K,V>
- 类型参数:
K- the key typeV- the value type
Internal representation of map fields in generated messages.
This class supports accessing the map field as a
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.-
方法概要
修饰符和类型方法说明voidclear()Clear.copy()Returns a deep copy of this MapField.static <K,V> MapField<K, V> emptyMapField(MapEntry<K, V> defaultEntry) Returns an immutable empty MapField.booleangetMap()Gets the map.Gets the mutable map.inthashCode()voidMerge from.static <K,V> MapField<K, V> newMapField(MapEntry<K, V> defaultEntry) Creates a new mutable empty MapField.
-
方法详细资料
-
emptyMapField
Returns an immutable empty MapField.- 类型参数:
K- the key typeV- the value type- 参数:
defaultEntry- the default entry- 返回:
- the map field
-
newMapField
Creates a new mutable empty MapField.- 类型参数:
K- the key typeV- the value type- 参数:
defaultEntry- the default entry- 返回:
- the map field
-
getMap
Gets the map.- 返回:
- the map
-
getMutableMap
Gets the mutable map.- 返回:
- the mutable map
-
mergeFrom
Merge from.- 参数:
other- the other
-
clear
public void clear()Clear. -
equals
-
hashCode
public int hashCode() -
copy
Returns a deep copy of this MapField.- 返回:
- the map field
-