public final class SerializedValue extends Object implements org.joda.beans.ImmutableBean
This bean allows a Java object to be passed around in serialized form.
The object can be a Joda-Convert type, a Joda-Bean or implement Serializable.
This is useful where an object needs to be transported to another Java process where
the object's class may not be on the classpath.
| Modifier and Type | Method and Description |
|---|---|
<T> T |
deserialize(Class<T> javaType)
Deserializes the value.
|
boolean |
equals(Object obj) |
int |
hashCode() |
static org.joda.beans.TypedMetaBean<SerializedValue> |
meta()
The meta-bean for
SerializedValue. |
org.joda.beans.TypedMetaBean<SerializedValue> |
metaBean() |
static <T> SerializedValue |
serialize(Class<T> javaType,
T value)
Obtains an instance by serializing the value based on the declared Java type.
|
String |
toString() |
public static <T> SerializedValue serialize(Class<T> javaType, T value)
The declared Java type is not necessarily the same as the actual type of the value. For example, the declared type might be an interface and the actual type the implementation class.
T - the type of the valuejavaType - the declared Java typevalue - the value, may be null, a Joda-Convert type, Joda-Bean, or SerializableRuntimeException - if the value cannot be storedpublic <T> T deserialize(Class<T> javaType)
This converts the value from the underlying string or binary form. As such, it might throw an exception. The intention is that deserialization uses the same Java type as serialization.
T - the type of the valuejavaType - the declared Java typeRuntimeException - if the value cannot be deserializedpublic static org.joda.beans.TypedMetaBean<SerializedValue> meta()
SerializedValue.public org.joda.beans.TypedMetaBean<SerializedValue> metaBean()
metaBean in interface org.joda.beans.BeanCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.