/** 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); }