Class ObjectValueImpl
- java.lang.Object
-
- org.camunda.bpm.engine.variable.impl.value.AbstractTypedValue<java.lang.Object>
-
- org.camunda.bpm.engine.variable.impl.value.ObjectValueImpl
-
- All Implemented Interfaces:
java.io.Serializable
,ObjectValue
,SerializableValue
,TypedValue
public class ObjectValueImpl extends AbstractTypedValue<java.lang.Object> implements ObjectValue
- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isDeserialized
protected java.lang.String
objectTypeName
protected java.lang.String
serializationDataFormat
protected java.lang.String
serializedValue
-
Fields inherited from class org.camunda.bpm.engine.variable.impl.value.AbstractTypedValue
isTransient, type, value
-
-
Constructor Summary
Constructors Constructor Description ObjectValueImpl(java.lang.Object value)
ObjectValueImpl(java.lang.Object value, boolean isTransient)
ObjectValueImpl(java.lang.Object deserializedValue, java.lang.String serializedValue, java.lang.String serializationDataFormat, java.lang.String objectTypeName, boolean isDeserialized)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
getObjectType()
Returns the Class this object is an instance of.java.lang.String
getObjectTypeName()
A String representation of the Object's type name.java.lang.String
getSerializationDataFormat()
The serialization format used to serialize this value.SerializableValueType
getType()
The type of the value.java.lang.Object
getValue()
The actual value.<T> T
getValue(java.lang.Class<T> type)
Returns the object provided by this VariableValue.java.lang.String
getValueSerialized()
Returns the serialized value.boolean
isDeserialized()
Returns true in case the object is deserialized.void
setObjectTypeName(java.lang.String objectTypeName)
void
setSerializationDataFormat(java.lang.String serializationDataFormat)
void
setSerializedValue(java.lang.String serializedValue)
void
setTransient(boolean isTransient)
java.lang.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(java.lang.Object deserializedValue, java.lang.String serializedValue, java.lang.String serializationDataFormat, java.lang.String objectTypeName, boolean isDeserialized)
-
ObjectValueImpl
public ObjectValueImpl(java.lang.Object value)
-
ObjectValueImpl
public ObjectValueImpl(java.lang.Object value, boolean isTransient)
-
-
Method Detail
-
getSerializationDataFormat
public java.lang.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(java.lang.String serializationDataFormat)
-
getObjectTypeName
public java.lang.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(java.lang.String objectTypeName)
-
getValueSerialized
public java.lang.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(java.lang.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 java.lang.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<java.lang.Object>
- Returns:
- the value
-
getValue
public <T> T getValue(java.lang.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 java.lang.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<java.lang.Object>
- Returns:
- the type of the value.
-
setTransient
public void setTransient(boolean isTransient)
- Overrides:
setTransient
in classAbstractTypedValue<java.lang.Object>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractTypedValue<java.lang.Object>
-
-