Package energy.eddie.cim.serde
Interface MessageSerde
- All Known Implementing Classes:
JsonMessageSerde,XmlMessageSerde
public interface MessageSerde
A serde is a SERializer-DEserializer, which supports one or multiple formats to serialize and deserialize objects to and from.
-
Method Summary
Modifier and TypeMethodDescription<T> Tdeserialize(byte[] message, Class<T> messageType) Deserializes a message to a given class.byte[]Serializes an object to a byte array.
-
Method Details
-
serialize
Serializes an object to a byte array.- Parameters:
message- the object to be serialized.- Returns:
- a serialized byte array
- Throws:
SerializationException- if the serialization failed
-
deserialize
Deserializes a message to a given class.- Type Parameters:
T- the destination type.- Parameters:
message- the message that should be deserialized.messageType- the class of the destination type.- Returns:
- the deserialized object.
- Throws:
DeserializationException- if the deserialization fails.
-