Class ParameterMap
java.lang.Object
java.util.AbstractMap<String,Object>
java.util.concurrent.ConcurrentHashMap<String,Object>
io.nosqlbench.nb.api.engine.activityimpl.ParameterMap
- All Implemented Interfaces:
Serializable,ConcurrentMap<String,,Object> Map<String,,Object> Bindings,org.graalvm.polyglot.proxy.Proxy,org.graalvm.polyglot.proxy.ProxyObject
public class ParameterMap
extends ConcurrentHashMap<String,Object>
implements Bindings, org.graalvm.polyglot.proxy.ProxyObject
A concurrently accessible parameter map which holds both keys and values as strings. An atomic change counter tracks updates, to allow interested consumers to determine when to re-read values across threads. The basic format is <paramname>=<paramvalue>;...
To create a parameter map, use one of the static parse... methods.
No non-String types are used internally. Everything is encoded as a String, even though the generic type is parameterized for Bindings support.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classNested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
ConcurrentHashMap.KeySetView<K,V> Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ParameterMap.Listener listener) voidassertOnlyOneOf(String... paramName) voidclear()entrySet()Get the atomic change counter for this parameter map.getOptionalBoolean(String paramName) getOptionalDouble(String paramName) getOptionalDoubleBytes(String paramName) getOptionalDoubleUnitCount(String paramName) getOptionalInteger(String paramName) getOptionalLong(String paramName) getOptionalLongBytes(String paramName) getOptionalLongUnitCount(String paramName) getOptionalMillisUnit(String paramName) getOptionalNamedParameter(String... paramName) getOptionalString(String... paramName) intgetSize()booleanstatic ParameterMapparseOrException(String encodedParams) static Optional<ParameterMap> parseParams(String encodedParams) voidvoidvoidremoveListener(ParameterMap.Listener listener) booleanremoveMember(String key) removeOptionalString(String... paramName) voidvoidsetSilently(String paramName, Object newValue) booleantakeBoolOrDefault(String paramName, boolean defaultBoolValue) takeDoubleOrDefault(String paramName, double defaultDoubleValue) inttakeIntOrDefault(String paramName, int paramDefault) takeLongOrDefault(String paramName, Long defaultLongValue) takeStringOrDefault(String paramName, String defaultStringValue) static StringtoString()Methods inherited from class java.util.concurrent.ConcurrentHashMap
compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, valuesMethods inherited from class java.util.AbstractMap
cloneMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.script.Bindings
containsKey
-
Constructor Details
-
ParameterMap
-
-
Method Details
-
assertOnlyOneOf
-
getOptionalString
-
removeOptionalString
-
getOptionalNamedParameter
-
getOptionalLong
-
getOptionalMillisUnit
-
getOptionalLongUnitCount
-
getOptionalDoubleUnitCount
-
getOptionalLongBytes
-
getOptionalDoubleBytes
-
getOptionalDouble
-
getOptionalBoolean
-
takeLongOrDefault
-
takeDoubleOrDefault
-
takeStringOrDefault
-
takeIntOrDefault
-
takeBoolOrDefault
-
get
-
setSilently
-
set
-
put
-
putAll
-
remove
-
clear
-
entrySet
-
getChangeCounter
Get the atomic change counter for this parameter map. It getes incremented whenever any changes are made to the map.- Returns:
- the atomic long change counter
-
toString
- Overrides:
toStringin classConcurrentHashMap<String,Object>
-
addListener
-
removeListener
-
getSize
public int getSize() -
parseOrException
-
parseParams
-
getOptionalInteger
-
getMember
-
getMemberKeys
- Specified by:
getMemberKeysin interfaceorg.graalvm.polyglot.proxy.ProxyObject
-
hasMember
- Specified by:
hasMemberin interfaceorg.graalvm.polyglot.proxy.ProxyObject
-
putMember
- Specified by:
putMemberin interfaceorg.graalvm.polyglot.proxy.ProxyObject
-
removeMember
- Specified by:
removeMemberin interfaceorg.graalvm.polyglot.proxy.ProxyObject
-
getStringStringMap
-
toJSON
-