Class ObjectValueImpl
- java.lang.Object
-
- org.camunda.bpm.engine.variable.impl.value.AbstractTypedValue<Object>
-
- org.camunda.bpm.engine.variable.impl.value.ObjectValueImpl
-
- All Implemented Interfaces:
Serializable
,ObjectValue
,SerializableValue
,TypedValue
public class ObjectValueImpl extends AbstractTypedValue<Object> implements ObjectValue
- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isDeserialized
protected String
objectTypeName
protected String
serializationDataFormat
protected String
serializedValue
-
Fields inherited from class org.camunda.bpm.engine.variable.impl.value.AbstractTypedValue
isTransient, type, value
-
-
Constructor Summary
Constructors Constructor Description ObjectValueImpl(Object value)
ObjectValueImpl(Object value, boolean isTransient)
ObjectValueImpl(Object deserializedValue, String serializedValue, String serializationDataFormat, String objectTypeName, boolean isDeserialized)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>
getObjectType()
Returns the Class this object is an instance of.String
getObjectTypeName()
A String representation of the Object's type name.String
getSerializationDataFormat()
The serialization format used to serialize this value.SerializableValueType
getType()
The type of the value.Object
getValue()
The actual value.<T> T
getValue(Class<T> type)
Returns the object provided by this VariableValue.String
getValueSerialized()
Returns the serialized value.boolean
isDeserialized()
Returns true in case the object is deserialized.void
setObjectTypeName(String objectTypeName)
void
setSerializationDataFormat(String serializationDataFormat)
void
setSerializedValue(String serializedValue)
void
setTransient(boolean isTransient)
String
toString()
-
Methods inherited from class org.camunda.bpm.engine.variable.impl.value.AbstractTypedValue
isTransient
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.variable.value.TypedValue
isTransient
-
-
-
-
Constructor Detail
-
ObjectValueImpl
public ObjectValueImpl(Object deserializedValue, String serializedValue, String serializationDataFormat, String objectTypeName, boolean isDeserialized)
-
ObjectValueImpl
public ObjectValueImpl(Object value)
-
ObjectValueImpl
public ObjectValueImpl(Object value, boolean isTransient)
-
-
Method Detail
-
getSerializationDataFormat
public String getSerializationDataFormat()
Description copied from interface:SerializableValue
The serialization format used to serialize this value.- Specified by:
getSerializationDataFormat
in interfaceSerializableValue
- Returns:
- the serialization format used to serialize this variable.
-
setSerializationDataFormat
public void setSerializationDataFormat(String serializationDataFormat)
-
getObjectTypeName
public String getObjectTypeName()
Description copied from interface:ObjectValue
A String representation of the Object's type name. Usually the canonical class name of the Java Class this object is an instance of.- Specified by:
getObjectTypeName
in interfaceObjectValue
- Returns:
- the Object's type name.
-
setObjectTypeName
public void setObjectTypeName(String objectTypeName)
-
getValueSerialized
public String getValueSerialized()
Description copied from interface:SerializableValue
Returns the serialized value. In case the serializaton data format (as returned bySerializableValue.getSerializationDataFormat()
) is not text based, a base 64 encoded representation of the value is returned The serialized value is a snapshot of the state of the value as it is serialized to the process engine database.- Specified by:
getValueSerialized
in interfaceSerializableValue
-
setSerializedValue
public void setSerializedValue(String serializedValue)
-
isDeserialized
public boolean isDeserialized()
Description copied from interface:ObjectValue
Returns true in case the object is deserialized. If this method returns true, it is safe to call the methods- Specified by:
isDeserialized
in interfaceObjectValue
- Specified by:
isDeserialized
in interfaceSerializableValue
- Returns:
- true if the object is deserialized.
-
getValue
public Object getValue()
Description copied from interface:TypedValue
The actual value. May be null in case the value is null.- Specified by:
getValue
in interfaceObjectValue
- Specified by:
getValue
in interfaceSerializableValue
- Specified by:
getValue
in interfaceTypedValue
- Overrides:
getValue
in classAbstractTypedValue<Object>
- Returns:
- the value
-
getValue
public <T> T getValue(Class<T> type)
Description copied from interface:ObjectValue
Returns the object provided by this VariableValue. Allows type-safe access to objects by passing in the class.- Specified by:
getValue
in interfaceObjectValue
- Parameters:
type
- the java class the value should be cast to- Returns:
- the object represented by this TypedValue.
-
getObjectType
public Class<?> getObjectType()
Description copied from interface:ObjectValue
Returns the Class this object is an instance of.- Specified by:
getObjectType
in interfaceObjectValue
- Returns:
- the Class this object is an instance of
-
getType
public SerializableValueType getType()
Description copied from interface:TypedValue
The type of the value. See ValueType for a list of built-in ValueTypes.- Specified by:
getType
in interfaceSerializableValue
- Specified by:
getType
in interfaceTypedValue
- Overrides:
getType
in classAbstractTypedValue<Object>
- Returns:
- the type of the value.
-
setTransient
public void setTransient(boolean isTransient)
- Overrides:
setTransient
in classAbstractTypedValue<Object>
-
toString
public String toString()
- Overrides:
toString
in classAbstractTypedValue<Object>
-
-