|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.item.ExecutionContext
public class ExecutionContext
Object representing a context for an 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.
Constructor Summary | |
---|---|
ExecutionContext()
Default constructor. |
|
ExecutionContext(ExecutionContext executionContext)
|
|
ExecutionContext(Map map)
Initializes a new execution context with the contents of another map. |
Method Summary | |
---|---|
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 |
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. |
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. |
Properties |
getProperties()
Deprecated. to be removed with no replacement in 2.0. Should not be part of public API (test purposes only) |
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 (must be Serializable). |
void |
putDouble(String key,
double value)
Add a Double 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. |
int |
size()
Returns number of entries in the context |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExecutionContext()
public ExecutionContext(Map map)
map
- Initial contents of context.public ExecutionContext(ExecutionContext executionContext)
executionContext
- Method Detail |
---|
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 putDouble(String key, double value)
key
- Key to add to contextvalue
- Value to associate with keypublic void put(String key, Object value)
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 for
String
valuepublic String getString(String key, String defaultString)
key
- The key to get a value fordefaultString
- Default to return if key is not represented
String
value if key is repreesnted, specified
default otherwisepublic long getLong(String key)
key
- The key to get a value for
Long
valuepublic long getLong(String key, long defaultLong)
key
- The key to get a value fordefaultLong
- Default to return if key is not represented
long
value if key is represented, specified
default otherwisepublic double getDouble(String key)
key
- The key to get a value for
Double
valuepublic double getDouble(String key, double defaultDouble)
key
- The key to get a value fordefaultDouble
- Default to return if key is not represented
double
value if key is represented, specified
default otherwisepublic Object get(String key)
key
- The key to get a value for
public boolean isEmpty()
Map.isEmpty()
public void clearDirtyFlag()
public Set entrySet()
Map.entrySet()
public boolean containsKey(String key)
key
- Key to check existence for
Map.containsKey(Object)
public boolean containsValue(Object value)
value
- Value to check existence for
Map.containsValue(Object)
public Properties getProperties()
Properties
object containing String
versions of the contents of the context.
Properties
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public int size()
Map.size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |