public class CopyOnWriteContent extends com.yahoo.component.provider.FreezableClass implements Cloneable
Modifier and Type | Field and Description |
---|---|
private Map<String,Object> |
map
The modifiable content of this.
|
private Map<String,Object> |
unmodifiableMap
If map is non-null this is either null (not instantiated yet) or an unmodifiable wrapper of map,
if map is null this is either null (this is empty) or a reference to the map of the content this was cloned from
|
Constructor and Description |
---|
CopyOnWriteContent()
Create a WRITABLE, empty instance
|
Modifier and Type | Method and Description |
---|---|
CopyOnWriteContent |
clone() |
private void |
copyIfNotWritable() |
private static CopyOnWriteContent |
createInCopyOnWriteState(Map<String,Object> unmodifiableMap)
Create a COPYONWRITE instance with some initial state
|
private static CopyOnWriteContent |
createInWritableState(Map<String,Object> map)
Create a WRITABLE instance with some initial state
|
(package private) static Map<String,Object> |
deepClone(Map<String,Object> map)
Deep clones a map - this handles all value types which can be found in a query profile
|
void |
freeze() |
Object |
get(String key) |
private boolean |
isDeepUnmodifiable(Map<String,Object> map) |
private boolean |
isEmpty() |
private boolean |
isWritable() |
void |
put(String key,
Object value) |
void |
remove(String key) |
Map<String,Object> |
unmodifiableMap() |
private Map<String,Object> map
private static CopyOnWriteContent createInCopyOnWriteState(Map<String,Object> unmodifiableMap)
private static CopyOnWriteContent createInWritableState(Map<String,Object> map)
public void freeze()
freeze
in interface com.yahoo.component.provider.Freezable
freeze
in class com.yahoo.component.provider.FreezableClass
private boolean isEmpty()
private boolean isWritable()
public CopyOnWriteContent clone()
clone
in class com.yahoo.component.provider.FreezableClass
static Map<String,Object> deepClone(Map<String,Object> map)
public void remove(String key)
private void copyIfNotWritable()
Copyright © 2018. All rights reserved.