Package org.axonframework.serialization
Class UnknownSerializedType
java.lang.Object
org.axonframework.serialization.UnknownSerializedType
Class representing a serialized object of which there is no class available in the current class loader. This
class provides access to the raw underlying data, as well as any format supported by the serializer.
- Since:
- 4.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionUnknownSerializedType(Serializer serializer, SerializedObject<?> serializedObject) Initialize the unknown type, using givenserializerandserializedObject. -
Method Summary
Modifier and TypeMethodDescription<T> TReturns the data contained in the serialized object in the givendesiredFormat, if supported.Returns the type of the serialized object, for which no class could be resolved.<T> booleansupportsFormat(Class<T> desiredFormat) Indicates whether the givendesiredFormatis supported as a representation for this type.
-
Constructor Details
-
UnknownSerializedType
Initialize the unknown type, using givenserializerandserializedObject.- Parameters:
serializer- the serializer attempting to deserialize the objectserializedObject- the object being deserialized
-
-
Method Details
-
supportsFormat
Indicates whether the givendesiredFormatis supported as a representation for this type. More specifically, it will consult the serializer that returned this instance whether it has a converter to convert the serialized object's data to the desired type- Type Parameters:
T- the format in which the serialized object is desired- Parameters:
desiredFormat- the format in which the serialized object is desired- Returns:
trueif the format is supported, otherwisefalse
-
readData
Returns the data contained in the serialized object in the givendesiredFormat, if supported. If the desired format is unsupported, an exception is thrown, depending on the serializer.To verify whether a format is supported, use
supportsFormat(Class).- Type Parameters:
T- the format in which the data is desired- Parameters:
desiredFormat- the format in which the data is desired- Returns:
- the data in the desired format
-
serializedType
Returns the type of the serialized object, for which no class could be resolved.- Returns:
- the type of the serialized object
-