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 givenPersistentData
object to a byte array.default String
toJson
(PersistentData data) Serializes the givenPersistentData
object to a JSON string.default com.inductiveautomation.ignition.common.gson.JsonElement
toJsonElement
(PersistentData data) Serializes the givenPersistentData
object to aJsonElement
.default com.google.protobuf.Message
toProtoMessage
(PersistentData data) Serializes the givenPersistentData
object to a ProtobufMessage
.
-
Method Details
-
toBytes
Serializes the givenPersistentData
object to a byte array.- Parameters:
data
- thePersistentData
object to serialize- Returns:
- the serialized bytes
- Throws:
SerializeException
- if there is an error during serialization
-
toJson
Serializes the givenPersistentData
object to a JSON string.- Parameters:
data
- thePersistentData
object 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 givenPersistentData
object to aJsonElement
.- Parameters:
data
- thePersistentData
object to serialize- Returns:
- the serialized
JsonElement
- Throws:
SerializeException
- if there is an error during serialization
-
toProtoMessage
Serializes the givenPersistentData
object to a ProtobufMessage
.- Parameters:
data
- thePersistentData
object to serialize- Returns:
- the serialized Protobuf
Message
- Throws:
SerializeException
- if there is an error during serialization
-