public class ExecutionContext extends Object implements Serializable
ItemStream. It is a thin wrapper
for a map that allows optionally for type safety on reads. It also allows for
dirty checking by setting a 'dirty' flag whenever any put is called.
Note that putting null value is equivalent to removing the entry
for the given key.| Constructor and Description |
|---|
ExecutionContext()
Default constructor.
|
ExecutionContext(ExecutionContext executionContext) |
ExecutionContext(Map<String,Object> map)
Initializes a new execution context with the contents of another map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearDirtyFlag()
Clears the dirty flag.
|
boolean |
containsKey(String key)
Indicates whether or not a key is represented in this context.
|
boolean |
containsValue(Object value)
Indicates whether or not a value is represented in this context.
|
Set<Map.Entry<String,Object>> |
entrySet()
Returns the entry set containing the contents of this context.
|
boolean |
equals(Object obj) |
Object |
get(String key)
Getter for the value represented by the provided key.
|
double |
getDouble(String key)
Typesafe Getter for the Double represented by the provided key.
|
double |
getDouble(String key,
double defaultDouble)
Typesafe Getter for the Double represented by the provided key with
default value to return if key is not represented.
|
int |
getInt(String key)
Typesafe Getter for the Integer represented by the provided key.
|
int |
getInt(String key,
int defaultInt)
Typesafe Getter for the Integer represented by the provided key with
default value to return if key is not represented.
|
long |
getLong(String key)
Typesafe Getter for the Long represented by the provided key.
|
long |
getLong(String key,
long defaultLong)
Typesafe Getter for the Long represented by the provided key with default
value to return if key is not represented.
|
String |
getString(String key)
Typesafe Getter for the String represented by the provided key.
|
String |
getString(String key,
String defaultString)
Typesafe Getter for the String represented by the provided key with
default value to return if key is not represented.
|
int |
hashCode() |
boolean |
isDirty()
Indicates if context has been changed with a "put" operation since the
dirty flag was last cleared.
|
boolean |
isEmpty()
Indicates whether or not the context is empty.
|
void |
put(String key,
Object value)
Add an Object value to the context.
|
void |
putDouble(String key,
double value)
Add a Double value to the context.
|
void |
putInt(String key,
int value)
Adds an Integer value to the context.
|
void |
putLong(String key,
long value)
Adds a Long value to the context.
|
void |
putString(String key,
String value)
Adds a String value to the context.
|
Object |
remove(String key)
Removes the mapping for a key from this context if it is present.
|
int |
size()
Returns number of entries in the context
|
String |
toString() |
public ExecutionContext()
public ExecutionContext(Map<String,Object> map)
map - Initial contents of context.public ExecutionContext(ExecutionContext executionContext)
executionContext - public void putString(String key, String value)
key - Key to add to contextvalue - Value to associate with keypublic void putLong(String key, long value)
key - Key to add to contextvalue - Value to associate with keypublic void putInt(String key, int value)
key - Key to add to contextvalue - Value to associate with keypublic void putDouble(String key, double value)
key - Key to add to contextvalue - Value to associate with keypublic void put(String key, Object value)
null
value for a given key removes the key.key - Key to add to contextvalue - Value to associate with keypublic boolean isDirty()
public String getString(String key)
key - The key to get a value forString valuepublic String getString(String key, String defaultString)
key - The key to get a value fordefaultString - Default to return if key is not representedString value if key is repreesnted, specified
default otherwisepublic long getLong(String key)
key - The key to get a value forLong valuepublic long getLong(String key, long defaultLong)
key - The key to get a value fordefaultLong - Default to return if key is not representedlong value if key is represented, specified
default otherwisepublic int getInt(String key)
key - The key to get a value forInteger valuepublic int getInt(String key, int defaultInt)
key - The key to get a value fordefaultInt - Default to return if key is not representedint value if key is represented, specified
default otherwisepublic double getDouble(String key)
key - The key to get a value forDouble valuepublic double getDouble(String key, double defaultDouble)
key - The key to get a value fordefaultDouble - Default to return if key is not representeddouble value if key is represented, specified
default otherwisepublic Object get(String key)
key - The key to get a value forpublic boolean isEmpty()
Map.isEmpty()public void clearDirtyFlag()
public Set<Map.Entry<String,Object>> entrySet()
Map.entrySet()public boolean containsKey(String key)
key - Key to check existence forMap.containsKey(Object)public Object remove(String key)
Map.remove(Object)public boolean containsValue(Object value)
value - Value to check existence forMap.containsValue(Object)public int size()
Map.size()Copyright © 2014 Pivotal. All rights reserved.