Interface SerializationContext
public interface SerializationContext
Context for serialization used when serializing data with a
PersistentSerializer.-
Method Summary
Modifier and TypeMethodDescriptiondefault byte[]toBytes(PersistentData data) Serializes the givenPersistentDataobject to a byte array.default StringtoJson(PersistentData data) Serializes the givenPersistentDataobject to a JSON string.default com.inductiveautomation.ignition.common.gson.JsonElementtoJsonElement(PersistentData data) Serializes the givenPersistentDataobject to aJsonElement.default com.google.protobuf.MessagetoProtoMessage(PersistentData data) Serializes the givenPersistentDataobject to a ProtobufMessage.
-
Method Details
-
toBytes
Serializes the givenPersistentDataobject to a byte array.- Parameters:
data- thePersistentDataobject to serialize- Returns:
- the serialized bytes
- Throws:
SerializeException- if there is an error during serialization
-
toJson
Serializes the givenPersistentDataobject to a JSON string.- Parameters:
data- thePersistentDataobject to serialize- Returns:
- the serialized JSON string
- Throws:
SerializeException- if there is an error during serialization
-
toJsonElement
default com.inductiveautomation.ignition.common.gson.JsonElement toJsonElement(PersistentData data) throws SerializeException Serializes the givenPersistentDataobject to aJsonElement.- Parameters:
data- thePersistentDataobject to serialize- Returns:
- the serialized
JsonElement - Throws:
SerializeException- if there is an error during serialization
-
toProtoMessage
Serializes the givenPersistentDataobject to a ProtobufMessage.- Parameters:
data- thePersistentDataobject to serialize- Returns:
- the serialized Protobuf
Message - Throws:
SerializeException- if there is an error during serialization
-