@Override protected StringMap childValue(final StringMap parentValue) { if (parentValue == null) { return null; } StringMap stringMap = createStringMap(parentValue); stringMap.freeze(); return stringMap; } };
@Override public void remove(final String key) { final StringMap map = localMap.get(); if (map != null) { final StringMap copy = createStringMap(map); copy.remove(key); copy.freeze(); localMap.set(copy); } }
@Override public void removeAll(final Iterable<String> keys) { final StringMap map = localMap.get(); if (map != null) { final StringMap copy = createStringMap(map); for (final String key : keys) { copy.remove(key); } copy.freeze(); localMap.set(copy); } }
@Override public void putAll(final Map<String, String> values) { if (values == null || values.isEmpty()) { return; } StringMap map = localMap.get(); map = map == null ? createStringMap() : createStringMap(map); for (final Map.Entry<String, String> entry : values.entrySet()) { map.putValue(entry.getKey(), entry.getValue()); } map.freeze(); localMap.set(map); }
@Override public <V> void putAllValues(final Map<String, V> values) { if (values == null || values.isEmpty()) { return; } StringMap map = localMap.get(); map = map == null ? createStringMap() : createStringMap(map); for (final Map.Entry<String, V> entry : values.entrySet()) { map.putValue(entry.getKey(), entry.getValue()); } map.freeze(); localMap.set(map); }
@Override public void putValue(final String key, final Object value) { StringMap map = localMap.get(); map = map == null ? createStringMap() : createStringMap(map); map.putValue(key, value); map.freeze(); localMap.set(map); }
@Override public void remove(final String key) { final StringMap map = localMap.get(); if (map != null) { final StringMap copy = createStringMap(map); copy.remove(key); copy.freeze(); localMap.set(copy); } }
@Override public void removeAll(final Iterable<String> keys) { final StringMap map = localMap.get(); if (map != null) { final StringMap copy = createStringMap(map); for (final String key : keys) { copy.remove(key); } copy.freeze(); localMap.set(copy); } }
@Override public void putAll(final Map<String, String> values) { if (values == null || values.isEmpty()) { return; } StringMap map = localMap.get(); map = map == null ? createStringMap() : createStringMap(map); for (final Map.Entry<String, String> entry : values.entrySet()) { map.putValue(entry.getKey(), entry.getValue()); } map.freeze(); localMap.set(map); }
@Override public <V> void putAllValues(final Map<String, V> values) { if (values == null || values.isEmpty()) { return; } StringMap map = localMap.get(); map = map == null ? createStringMap() : createStringMap(map); for (final Map.Entry<String, V> entry : values.entrySet()) { map.putValue(entry.getKey(), entry.getValue()); } map.freeze(); localMap.set(map); }
@Override public void putValue(final String key, final Object value) { StringMap map = localMap.get(); map = map == null ? createStringMap() : createStringMap(map); map.putValue(key, value); map.freeze(); localMap.set(map); }
result.freeze(); return result;