public class JobDataMap extends StringKeyDirtyFlagMap implements Serializable
Job
instances.
JobDataMap
instances are stored once when the Job
is added to a scheduler. They are also re-persisted after every execution of
jobs annotated with @PersistJobDataAfterExecution
.
JobDataMap
instances can also be stored with a
Trigger
. This can be useful in the case where you have a Job
that is stored in the scheduler for regular/repeated use by multiple
Triggers, yet with each independent triggering, you want to supply the
Job with different data inputs.
The JobExecutionContext
passed to a Job at execution time
also contains a convenience JobDataMap
that is the result
of merging the contents of the trigger's JobDataMap (if any) over the
Job's JobDataMap (if any).
Update since 2.2.4 - We keep an dirty flag for this map so that whenever you modify(add/delete) any of the entries,
it will set to "true". However if you create new instance using an exising map with JobDataMap(Map)
, then
the dirty flag will NOT be set to "true" until you modify the instance.
Job
,
PersistJobDataAfterExecution
,
Trigger
,
JobExecutionContext
,
Serialized FormConstructor and Description |
---|
JobDataMap()
Create an empty
JobDataMap . |
JobDataMap(Map<?,?> map)
Create a
JobDataMap with the given data. |
Modifier and Type | Method and Description |
---|---|
Boolean |
getBooleanFromString(String key)
Retrieve the identified
Boolean value from the JobDataMap . |
boolean |
getBooleanValue(String key)
Retrieve the identified
boolean value from the
JobDataMap . |
boolean |
getBooleanValueFromString(String key)
Retrieve the identified
boolean value from the JobDataMap . |
Character |
getCharacterFromString(String key)
Retrieve the identified
Character value from the JobDataMap . |
char |
getCharFromString(String key)
Retrieve the identified
char value from the JobDataMap . |
Double |
getDoubleFromString(String key)
Retrieve the identified
Double value from the JobDataMap . |
double |
getDoubleValue(String key)
Retrieve the identified
double value from the JobDataMap . |
double |
getDoubleValueFromString(String key)
Retrieve the identified
double value from the JobDataMap . |
Float |
getFloatFromString(String key)
Retrieve the identified
Float value from the JobDataMap . |
float |
getFloatValue(String key)
Retrieve the identified
float value from the JobDataMap . |
float |
getFloatValueFromString(String key)
Retrieve the identified
float value from the JobDataMap . |
Integer |
getIntegerFromString(String key)
Retrieve the identified
int value from the JobDataMap . |
int |
getIntFromString(String key)
Retrieve the identified
int value from the JobDataMap . |
int |
getIntValue(String key)
Retrieve the identified
int value from the JobDataMap . |
Long |
getLongFromString(String key)
Retrieve the identified
Long value from the JobDataMap . |
long |
getLongValue(String key)
Retrieve the identified
long value from the JobDataMap . |
long |
getLongValueFromString(String key)
Retrieve the identified
long value from the JobDataMap . |
void |
putAsString(String key,
boolean value)
Adds the given
boolean value as a string version to the
Job 's data map. |
void |
putAsString(String key,
Boolean value)
Adds the given
Boolean value as a string version to the
Job 's data map. |
void |
putAsString(String key,
char value)
Adds the given
char value as a string version to the
Job 's data map. |
void |
putAsString(String key,
Character value)
Adds the given
Character value as a string version to the
Job 's data map. |
void |
putAsString(String key,
double value)
Adds the given
double value as a string version to the
Job 's data map. |
void |
putAsString(String key,
Double value)
Adds the given
Double value as a string version to the
Job 's data map. |
void |
putAsString(String key,
float value)
Adds the given
float value as a string version to the
Job 's data map. |
void |
putAsString(String key,
Float value)
Adds the given
Float value as a string version to the
Job 's data map. |
void |
putAsString(String key,
int value)
Adds the given
int value as a string version to the
Job 's data map. |
void |
putAsString(String key,
Integer value)
Adds the given
Integer value as a string version to the
Job 's data map. |
void |
putAsString(String key,
long value)
Adds the given
long value as a string version to the
Job 's data map. |
void |
putAsString(String key,
Long value)
Adds the given
Long value as a string version to the
Job 's data map. |
containsTransientData, equals, getAllowsTransientData, getBoolean, getChar, getDouble, getFloat, getInt, getKeys, getLong, getString, hashCode, put, put, put, put, put, put, put, put, removeTransientData, setAllowsTransientData
clear, clearDirtyFlag, clone, containsKey, containsValue, entrySet, get, getWrappedMap, isDirty, isEmpty, keySet, putAll, remove, size, values
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public JobDataMap()
Create an empty JobDataMap
.
public JobDataMap(Map<?,?> map)
Create a JobDataMap
with the given data.
public void putAsString(String key, boolean value)
Adds the given boolean
value as a string version to the
Job
's data map.
public void putAsString(String key, Boolean value)
Adds the given Boolean
value as a string version to the
Job
's data map.
public void putAsString(String key, char value)
Adds the given char
value as a string version to the
Job
's data map.
public void putAsString(String key, Character value)
Adds the given Character
value as a string version to the
Job
's data map.
public void putAsString(String key, double value)
Adds the given double
value as a string version to the
Job
's data map.
public void putAsString(String key, Double value)
Adds the given Double
value as a string version to the
Job
's data map.
public void putAsString(String key, float value)
Adds the given float
value as a string version to the
Job
's data map.
public void putAsString(String key, Float value)
Adds the given Float
value as a string version to the
Job
's data map.
public void putAsString(String key, int value)
Adds the given int
value as a string version to the
Job
's data map.
public void putAsString(String key, Integer value)
Adds the given Integer
value as a string version to the
Job
's data map.
public void putAsString(String key, long value)
Adds the given long
value as a string version to the
Job
's data map.
public void putAsString(String key, Long value)
Adds the given Long
value as a string version to the
Job
's data map.
public int getIntFromString(String key)
Retrieve the identified int
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public int getIntValue(String key)
Retrieve the identified int
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String or Integer.public Integer getIntegerFromString(String key)
Retrieve the identified int
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public boolean getBooleanValueFromString(String key)
Retrieve the identified boolean
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public boolean getBooleanValue(String key)
Retrieve the identified boolean
value from the
JobDataMap
.
ClassCastException
- if the identified object is not a String or Boolean.public Boolean getBooleanFromString(String key)
Retrieve the identified Boolean
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public char getCharFromString(String key)
Retrieve the identified char
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public Character getCharacterFromString(String key)
Retrieve the identified Character
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public double getDoubleValueFromString(String key)
Retrieve the identified double
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public double getDoubleValue(String key)
Retrieve the identified double
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String or Double.public Double getDoubleFromString(String key)
Retrieve the identified Double
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public float getFloatValueFromString(String key)
Retrieve the identified float
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public float getFloatValue(String key)
Retrieve the identified float
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String or Float.public Float getFloatFromString(String key)
Retrieve the identified Float
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public long getLongValueFromString(String key)
Retrieve the identified long
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.public long getLongValue(String key)
Retrieve the identified long
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String or Long.public Long getLongFromString(String key)
Retrieve the identified Long
value from the JobDataMap
.
ClassCastException
- if the identified object is not a String.Copyright 2001-2019, Terracotta, Inc.