Class VariableMapImpl
- java.lang.Object
-
- org.camunda.bpm.engine.variable.impl.VariableMapImpl
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.Map<java.lang.String,java.lang.Object>
,VariableContext
,VariableMap
public class VariableMapImpl extends java.lang.Object implements VariableMap, java.io.Serializable, VariableContext
- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,TypedValue>
variables
-
Constructor Summary
Constructors Constructor Description VariableMapImpl()
VariableMapImpl(java.util.Map<java.lang.String,java.lang.Object> map)
VariableMapImpl(VariableMapImpl map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
asValueMap()
VariableContext
asVariableContext()
Interprets the variable map as variable contextvoid
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
boolean
containsVariable(java.lang.String variableName)
Checks whether a variable with the given name is resolve through this context.java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>
entrySet()
boolean
equals(java.lang.Object obj)
java.lang.Object
get(java.lang.Object key)
<T> T
getValue(java.lang.String name, java.lang.Class<T> type)
<T extends TypedValue>
TgetValueTyped(java.lang.String name)
int
hashCode()
boolean
isEmpty()
java.util.Set<java.lang.String>
keySet()
java.lang.Object
put(java.lang.String key, java.lang.Object value)
void
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> m)
VariableMap
putValue(java.lang.String name, java.lang.Object value)
VariableMap
putValueTyped(java.lang.String name, TypedValue value)
java.lang.Object
remove(java.lang.Object key)
TypedValue
resolve(java.lang.String variableName)
Resolve a value in this context.int
size()
java.lang.String
toString()
java.util.Collection<java.lang.Object>
values()
-
-
-
Field Detail
-
variables
protected java.util.Map<java.lang.String,TypedValue> variables
-
-
Constructor Detail
-
VariableMapImpl
public VariableMapImpl(VariableMapImpl map)
-
VariableMapImpl
public VariableMapImpl(java.util.Map<java.lang.String,java.lang.Object> map)
-
VariableMapImpl
public VariableMapImpl()
-
-
Method Detail
-
putValue
public VariableMap putValue(java.lang.String name, java.lang.Object value)
- Specified by:
putValue
in interfaceVariableMap
-
putValueTyped
public VariableMap putValueTyped(java.lang.String name, TypedValue value)
- Specified by:
putValueTyped
in interfaceVariableMap
-
getValue
public <T> T getValue(java.lang.String name, java.lang.Class<T> type)
- Specified by:
getValue
in interfaceVariableMap
-
getValueTyped
public <T extends TypedValue> T getValueTyped(java.lang.String name)
- Specified by:
getValueTyped
in interfaceVariableMap
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
put
public java.lang.Object put(java.lang.String key, java.lang.Object value)
- Specified by:
put
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> m)
- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Specified by:
keySet
in interfaceVariableContext
- Returns:
- a set of all variable names resolvable through this Context.
-
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
values
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
hashCode
in classjava.lang.Object
-
asValueMap
public java.util.Map<java.lang.String,java.lang.Object> asValueMap()
-
resolve
public TypedValue resolve(java.lang.String variableName)
Description copied from interface:VariableContext
Resolve a value in this context.- Specified by:
resolve
in interfaceVariableContext
- Parameters:
variableName
- the name of the variable to resolve.- Returns:
- the value of the variable or null in case the variable does not exist.
-
containsVariable
public boolean containsVariable(java.lang.String variableName)
Description copied from interface:VariableContext
Checks whether a variable with the given name is resolve through this context.- Specified by:
containsVariable
in interfaceVariableContext
- Parameters:
variableName
- the name of the variable to check- Returns:
- true if the variable is resolve.
-
asVariableContext
public VariableContext asVariableContext()
Description copied from interface:VariableMap
Interprets the variable map as variable context- Specified by:
asVariableContext
in interfaceVariableMap
- Returns:
- A VariableContext which is capable of resolving all variables in the map
-
-