public class Variables extends Object
This class is the entry point to the process engine's typed variables API. Users can import the methods provided by this class using a static import:
import static org.camunda.bpm.engine.variable.Variables.*;
Modifier and Type | Class and Description |
---|---|
static class |
Variables.SerializationDataFormats
A set of builtin serialization dataformat constants.
|
Constructor and Description |
---|
Variables() |
Modifier and Type | Method and Description |
---|---|
static BooleanValue |
booleanValue(Boolean booleanValue)
Creates a new
BooleanValue that encapsulates the given booleanValue |
static BooleanValue |
booleanValue(Boolean booleanValue,
boolean isTransient)
Creates a new
BooleanValue that encapsulates the given booleanValue |
static BytesValue |
byteArrayValue(byte[] bytes)
Creates a new
BytesValue that encapsulates the given bytes |
static BytesValue |
byteArrayValue(byte[] bytes,
boolean isTransient)
Creates a new
BytesValue that encapsulates the given bytes |
static VariableMap |
createVariables()
Returns a new
VariableMap instance. |
static DateValue |
dateValue(Date date)
Creates a new
DateValue that encapsulates the given date |
static DateValue |
dateValue(Date date,
boolean isTransient)
Creates a new
DateValue that encapsulates the given date |
static DoubleValue |
doubleValue(Double doubleValue)
Creates a new
DoubleValue that encapsulates the given doubleValue |
static DoubleValue |
doubleValue(Double doubleValue,
boolean isTransient)
Creates a new
DoubleValue that encapsulates the given doubleValue |
static VariableContext |
emptyVariableContext() |
static FileValue |
fileValue(File file)
Shortcut for calling
Variables.fileValue(name).file(file).mimeType(type).create() . |
static FileValue |
fileValue(File file,
boolean isTransient)
Shortcut for calling
Variables.fileValue(name).file(file).mimeType(type).setTransient(isTransient).create() . |
static FileValueBuilder |
fileValue(String filename)
Returns a builder to create a new
FileValue with the given
filename . |
static FileValueBuilder |
fileValue(String filename,
boolean isTransient)
Returns a builder to create a new
FileValue with the given
filename . |
static VariableMap |
fromMap(Map<String,Object> map)
If the given map is not a variable map, adds all its entries as untyped
values to a new
VariableMap . |
static IntegerValue |
integerValue(Integer integer)
Creates a new
IntegerValue that encapsulates the given integer |
static IntegerValue |
integerValue(Integer integer,
boolean isTransient)
Creates a new
IntegerValue that encapsulates the given integer |
static LongValue |
longValue(Long longValue)
Creates a new
LongValue that encapsulates the given longValue |
static LongValue |
longValue(Long longValue,
boolean isTransient)
Creates a new
LongValue that encapsulates the given longValue |
static NumberValue |
numberValue(Number numberValue)
Creates an abstract Number value.
|
static NumberValue |
numberValue(Number numberValue,
boolean isTransient)
Creates an abstract Number value.
|
static ObjectValueBuilder |
objectValue(Object value)
Returns a builder to create a new
ObjectValue that encapsulates
the given value . |
static ObjectValueBuilder |
objectValue(Object value,
boolean isTransient)
Returns a builder to create a new
ObjectValue that encapsulates
the given value . |
static VariableMap |
putValue(String name,
Object value)
Shortcut for
Variables.createVariables().putValue(name, value) |
static VariableMap |
putValueTyped(String name,
TypedValue value)
Shortcut for
Variables.createVariables().putValueTyped(name, value) |
static SerializedObjectValueBuilder |
serializedObjectValue()
Returns a builder to create a new
ObjectValue from a serialized
object representation. |
static SerializedObjectValueBuilder |
serializedObjectValue(String value)
Shortcut for
Variables.serializedObjectValue().serializedValue(value) |
static SerializedObjectValueBuilder |
serializedObjectValue(String value,
boolean isTransient)
Shortcut for
Variables.serializedObjectValue().serializedValue(value).setTransient(isTransient) |
static ShortValue |
shortValue(Short shortValue)
Creates a new
ShortValue that encapsulates the given shortValue |
static ShortValue |
shortValue(Short shortValue,
boolean isTransient)
Creates a new
ShortValue that encapsulates the given shortValue |
static StringValue |
stringValue(String stringValue)
Creates a new
StringValue that encapsulates the given stringValue |
static StringValue |
stringValue(String stringValue,
boolean isTransient)
Creates a new
StringValue that encapsulates the given stringValue |
static TypedValue |
untypedNullValue()
|
static TypedValue |
untypedNullValue(boolean isTransient)
|
static TypedValue |
untypedValue(Object value)
Creates an untyped value, i.e.
|
static TypedValue |
untypedValue(Object value,
boolean isTransient)
Creates an untyped value, i.e.
|
public static VariableMap createVariables()
VariableMap
instance.public static VariableMap fromMap(Map<String,Object> map)
VariableMap
. If the given map is a VariableMap
,
it is returned as is.public static VariableMap putValue(String name, Object value)
Variables.createVariables().putValue(name, value)
public static VariableMap putValueTyped(String name, TypedValue value)
Variables.createVariables().putValueTyped(name, value)
public static ObjectValueBuilder objectValue(Object value)
ObjectValue
that encapsulates
the given value
.public static ObjectValueBuilder objectValue(Object value, boolean isTransient)
ObjectValue
that encapsulates
the given value
.public static SerializedObjectValueBuilder serializedObjectValue()
ObjectValue
from a serialized
object representation.public static SerializedObjectValueBuilder serializedObjectValue(String value)
Variables.serializedObjectValue().serializedValue(value)
public static SerializedObjectValueBuilder serializedObjectValue(String value, boolean isTransient)
Variables.serializedObjectValue().serializedValue(value).setTransient(isTransient)
public static IntegerValue integerValue(Integer integer)
IntegerValue
that encapsulates the given integer
public static IntegerValue integerValue(Integer integer, boolean isTransient)
IntegerValue
that encapsulates the given integer
public static StringValue stringValue(String stringValue)
StringValue
that encapsulates the given stringValue
public static StringValue stringValue(String stringValue, boolean isTransient)
StringValue
that encapsulates the given stringValue
public static BooleanValue booleanValue(Boolean booleanValue)
BooleanValue
that encapsulates the given booleanValue
public static BooleanValue booleanValue(Boolean booleanValue, boolean isTransient)
BooleanValue
that encapsulates the given booleanValue
public static BytesValue byteArrayValue(byte[] bytes)
BytesValue
that encapsulates the given bytes
public static BytesValue byteArrayValue(byte[] bytes, boolean isTransient)
BytesValue
that encapsulates the given bytes
public static DateValue dateValue(Date date)
DateValue
that encapsulates the given date
public static DateValue dateValue(Date date, boolean isTransient)
DateValue
that encapsulates the given date
public static LongValue longValue(Long longValue)
LongValue
that encapsulates the given longValue
public static LongValue longValue(Long longValue, boolean isTransient)
LongValue
that encapsulates the given longValue
public static ShortValue shortValue(Short shortValue)
ShortValue
that encapsulates the given shortValue
public static ShortValue shortValue(Short shortValue, boolean isTransient)
ShortValue
that encapsulates the given shortValue
public static DoubleValue doubleValue(Double doubleValue)
DoubleValue
that encapsulates the given doubleValue
public static DoubleValue doubleValue(Double doubleValue, boolean isTransient)
DoubleValue
that encapsulates the given doubleValue
public static NumberValue numberValue(Number numberValue)
integerValue(Integer)
, shortValue(Short)
,
longValue(Long)
and doubleValue(Double)
instead.public static NumberValue numberValue(Number numberValue, boolean isTransient)
integerValue(Integer)
, shortValue(Short)
,
longValue(Long)
and doubleValue(Double)
instead.public static TypedValue untypedNullValue()
public static TypedValue untypedNullValue(boolean isTransient)
public static TypedValue untypedValue(Object value)
TypedValue.getType()
returns null
for the returned instance.public static TypedValue untypedValue(Object value, boolean isTransient)
TypedValue.getType()
returns null
for the returned instance.public static FileValueBuilder fileValue(String filename)
FileValue
with the given
filename
.public static FileValueBuilder fileValue(String filename, boolean isTransient)
FileValue
with the given
filename
.public static FileValue fileValue(File file)
Variables.fileValue(name).file(file).mimeType(type).create()
.
The name is set to the file name and the mime type is detected via MimetypesFileTypeMap
.public static FileValue fileValue(File file, boolean isTransient)
Variables.fileValue(name).file(file).mimeType(type).setTransient(isTransient).create()
.
The name is set to the file name and the mime type is detected via MimetypesFileTypeMap
.public static VariableContext emptyVariableContext()
VariableContext
(from which no variables can be resolved).Copyright © 2019. All rights reserved.