- Common ways to obtain MapField
private void myMethod () {MapField m =
MapEntry defaultEntry;MapField.newMapField(defaultEntry)
MapEntry defaultEntry;MapField.emptyMapField(defaultEntry)
- Smart code suggestions by Codota
}
/** Gets a mutable Map view of this MapField. */ public Map<K, V> getMutableMap() { if (mode != StorageMode.MAP) { if (mode == StorageMode.LIST) { mapData = convertListToMap(listData); } listData = null; mode = StorageMode.MAP; } return mapData; }
/** Returns the content of this MapField as a read-only Map. */ public Map<K, V> getMap() { if (mode == StorageMode.LIST) { synchronized (this) { if (mode == StorageMode.LIST) { mapData = convertListToMap(listData); mode = StorageMode.BOTH; } } } return Collections.unmodifiableMap(mapData); }
/** Gets a mutable Map view of this MapField. */ public Map<K, V> getMutableMap() { if (mode != StorageMode.MAP) { if (mode == StorageMode.LIST) { mapData = convertListToMap(listData); } listData = null; mode = StorageMode.MAP; } return mapData; }
/** Returns the content of this MapField as a read-only Map. */ public Map<K, V> getMap() { if (mode == StorageMode.LIST) { synchronized (this) { if (mode == StorageMode.LIST) { mapData = convertListToMap(listData); mode = StorageMode.BOTH; } } } return Collections.unmodifiableMap(mapData); }