Class StoreMapImpl
java.lang.Object
com.terracottatech.store.definition.StoreMapImpl
- All Implemented Interfaces:
ComplexData,StoreMap,Map<String,TypedValue<?>>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.terracottatech.store.ComplexData
ComplexData.DotSpecParseException -
Constructor Summary
ConstructorsConstructorDescriptionStoreMapImpl(com.terracottatech.tcson.MutableSonMap mutable) StoreMapImpl(com.terracottatech.tcson.MutableSonMap map, boolean mutable) StoreMapImpl(com.terracottatech.tcson.ReadableSonMap rmap) StoreMapImpl(Map<String, TypedValue<?>> incoming) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) Set<Map.Entry<String,TypedValue<?>>> entrySet()booleanDo a filtering find operation across this object based on the Dot Notation given.TypedValue<?>inthashCode()booleanisEmpty()Is this object empty?booleanIs this a mutable representation?keySet()com.terracottatech.tcson.SonMap<? extends com.terracottatech.tcson.SonMapValue>liveMap()Make deep copy of this map, ensuring it is mutable.TypedValue<?>put(String key, TypedValue<?> value) voidputAll(Map<? extends String, ? extends TypedValue<?>> m) TypedValue<?>intsize()Size (number of elements) in this object.toString()toString(boolean skipWhitespace) Generate a string representation of this object in the specified format, with the specified compactness.Collection<TypedValue<?>>values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.terracottatech.store.ComplexData
notEmptyMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
StoreMapImpl
-
StoreMapImpl
public StoreMapImpl(com.terracottatech.tcson.ReadableSonMap rmap) -
StoreMapImpl
public StoreMapImpl(com.terracottatech.tcson.MutableSonMap mutable) -
StoreMapImpl
public StoreMapImpl(com.terracottatech.tcson.MutableSonMap map, boolean mutable) -
StoreMapImpl
public StoreMapImpl()
-
-
Method Details
-
find
Description copied from interface:ComplexDataDo a filtering find operation across this object based on the Dot Notation given.Dot notation is fairly simple yet powerful.
- '.' by itself matches the current object.
- '.foo' if the top level object is a map, matches the value of the 'foo' key
- '.foo.bar' matches the top level object as a map, then the value at key 'foo', then matches if that value is a map, then matches the value of its key 'bar'. etc.
- map keys for matching can also be expressed with more explicit
- '.[foo bar].[baz]'
- '.["foo\nbar"].baz'
- '.[1]' matches the list entry at index 1 (lists are zero based)
- '.[1:3]' matches the slice from 1 to 3 inclusive.
- finally, a stanza of '.[].' matches all entries. (wildcard)
This allows for reaching inside a nested complex structure and identifying only those pieces of interest. For example: '.employees.[].[first name]' might reach into a map, grab the list at key 'employees', go through every entry in the list, treat as a map, then grab the value of the 'first name' key in each map, this returning a list of every employee's first name.
- Specified by:
findin interfaceComplexData- Parameters:
dotSpec- dot specification- Returns:
Selectionof matchingTypedValue
-
mutableCopy
Description copied from interface:StoreMapMake deep copy of this map, ensuring it is mutable.- Specified by:
mutableCopyin interfaceComplexData- Specified by:
mutableCopyin interfaceStoreMap- Returns:
- mutable copy of this map
-
isMutable
public boolean isMutable()Description copied from interface:ComplexDataIs this a mutable representation?- Specified by:
isMutablein interfaceComplexData- Returns:
trueif mutable
-
liveMap
public com.terracottatech.tcson.SonMap<? extends com.terracottatech.tcson.SonMapValue> liveMap() -
size
public int size()Description copied from interface:ComplexDataSize (number of elements) in this object.- Specified by:
sizein interfaceComplexData- Specified by:
sizein interfaceMap<String,TypedValue<?>> - Returns:
- number of elements.
-
isEmpty
public boolean isEmpty()Description copied from interface:ComplexDataIs this object empty?- Specified by:
isEmptyin interfaceComplexData- Specified by:
isEmptyin interfaceMap<String,TypedValue<?>> - Returns:
- true if empty.
-
containsKey
- Specified by:
containsKeyin interfaceMap<String,TypedValue<?>>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,TypedValue<?>>
-
get
- Specified by:
getin interfaceMap<String,TypedValue<?>>
-
put
- Specified by:
putin interfaceMap<String,TypedValue<?>>
-
remove
- Specified by:
removein interfaceMap<String,TypedValue<?>>
-
putAll
- Specified by:
putAllin interfaceMap<String,TypedValue<?>>
-
clear
public void clear()- Specified by:
clearin interfaceMap<String,TypedValue<?>>
-
keySet
- Specified by:
keySetin interfaceMap<String,TypedValue<?>>
-
values
- Specified by:
valuesin interfaceMap<String,TypedValue<?>>
-
entrySet
- Specified by:
entrySetin interfaceMap<String,TypedValue<?>>
-
toString
Description copied from interface:ComplexDataGenerate a string representation of this object in the specified format, with the specified compactness.Native format is TC son, which is a more strongly typed version of JSON. Alternatively, the JSON compatible format grinds everything without a JSON type (chars, byte arrays) to strings, and all three numeric types become just JSON numbers.
- Specified by:
toStringin interfaceComplexData- Parameters:
skipWhitespace- line breaks and indention, or not.- Returns:
- String version of this object.
-
toString
-
equals
-
hashCode
public int hashCode()
-