Class AnnotationPersistentData.Serializer
java.lang.Object
com.inductiveautomation.ignition.gateway.history.AnnotationPersistentData.Serializer
- All Implemented Interfaces:
PersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB>
- Enclosing class:
- AnnotationPersistentData
public static class AnnotationPersistentData.Serializer
extends Object
implements PersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromBytes(byte[] bytes, DeserializationContext context) Deserializes the given byte array into a TPersistentDataobject.fromJson(String json, DeserializationContext context) Deserializes the given JSON string into a TPersistentDataobject.fromJsonElement(com.inductiveautomation.ignition.common.gson.JsonElement jsonElement, DeserializationContext context) Deserializes the givenJsonElementinto a TPersistentDataobject.fromProtoMessage(HistoryDataProto.AnnotationsPB message, DeserializationContext context) Deserializes the given ProtobufMessageinto a TPersistentDataobject.The TPersistentDataclass that is compatible with this serializer.byte[]toBytes(AnnotationPersistentData data, SerializationContext context) Serializes the given TPersistentDatainto a byte array.toJson(AnnotationPersistentData data, SerializationContext context) Serializes the given TPersistentDatainto a JSON string.com.inductiveautomation.ignition.common.gson.JsonElementtoJsonElement(AnnotationPersistentData data, SerializationContext context) Serializes the given TPersistentDatainto aJsonElement.toProtoMessage(AnnotationPersistentData data, SerializationContext context) Serializes the given TPersistentDatainto a ProtobufMessage.
-
Constructor Details
-
Serializer
public Serializer()
-
-
Method Details
-
toBytes
Description copied from interface:PersistentSerializerSerializes the given TPersistentDatainto a byte array.- Specified by:
toBytesin interfacePersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB> - Parameters:
data- The TPersistentDatato serialize.context- The serialization context to use for serialization.- Returns:
- The serialized data as a byte array.
-
toJson
public String toJson(AnnotationPersistentData data, @Nullable SerializationContext context) throws SerializeException Description copied from interface:PersistentSerializerSerializes the given TPersistentDatainto a JSON string.- Specified by:
toJsonin interfacePersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB> - Parameters:
data- The TPersistentDatato serialize.context- The serialization context to use for serialization.- Returns:
- The serialized data as a JSON string.
- Throws:
SerializeException- If an error occurs during serialization.
-
toJsonElement
public com.inductiveautomation.ignition.common.gson.JsonElement toJsonElement(AnnotationPersistentData data, @Nullable SerializationContext context) throws SerializeException Description copied from interface:PersistentSerializerSerializes the given TPersistentDatainto aJsonElement.- Specified by:
toJsonElementin interfacePersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB> - Parameters:
data- The TPersistentDatato serialize.context- The serialization context to use for serialization.- Returns:
- The serialized data as a
JsonElement. - Throws:
SerializeException- If an error occurs during serialization.
-
toProtoMessage
public HistoryDataProto.AnnotationsPB toProtoMessage(AnnotationPersistentData data, @Nullable SerializationContext context) Description copied from interface:PersistentSerializerSerializes the given TPersistentDatainto a ProtobufMessage.- Specified by:
toProtoMessagein interfacePersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB> - Parameters:
data- The TPersistentDatato serialize.context- The serialization context to use for serialization.- Returns:
- The serialized data as an S
Message.
-
fromBytes
public AnnotationPersistentData fromBytes(byte[] bytes, @Nullable DeserializationContext context) throws DeserializeException Description copied from interface:PersistentSerializerDeserializes the given byte array into a TPersistentDataobject.- Specified by:
fromBytesin interfacePersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB> - Parameters:
bytes- The byte array to deserialize.context- The deserialization context to use for deserialization.- Returns:
- The deserialized persistent data object.
- Throws:
DeserializeException- If an error occurs during deserialization.
-
fromJson
public AnnotationPersistentData fromJson(String json, @Nullable DeserializationContext context) throws DeserializeException Description copied from interface:PersistentSerializerDeserializes the given JSON string into a TPersistentDataobject.- Specified by:
fromJsonin interfacePersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB> - Parameters:
json- The JSON string to deserialize.context- The deserialization context to use for deserialization.- Returns:
- The deserialized persistent data object.
- Throws:
DeserializeException- If an error occurs during deserialization.
-
fromJsonElement
public AnnotationPersistentData fromJsonElement(com.inductiveautomation.ignition.common.gson.JsonElement jsonElement, @Nullable DeserializationContext context) throws DeserializeException Description copied from interface:PersistentSerializerDeserializes the givenJsonElementinto a TPersistentDataobject.- Specified by:
fromJsonElementin interfacePersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB> - Parameters:
jsonElement- TheJsonElementto deserialize.context- The deserialization context to use for deserialization.- Returns:
- The deserialized persistent data object.
- Throws:
DeserializeException- If an error occurs during deserialization.
-
fromProtoMessage
public AnnotationPersistentData fromProtoMessage(HistoryDataProto.AnnotationsPB message, @Nullable DeserializationContext context) Description copied from interface:PersistentSerializerDeserializes the given ProtobufMessageinto a TPersistentDataobject.- Specified by:
fromProtoMessagein interfacePersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB> - Parameters:
message- The S ProtobufMessageto deserialize.context- The deserialization context to use for deserialization.- Returns:
- The deserialized persistent data object.
-
getCompatibleClass
Description copied from interface:PersistentSerializerThe TPersistentDataclass that is compatible with this serializer.- Specified by:
getCompatibleClassin interfacePersistentSerializer<AnnotationPersistentData,HistoryDataProto.AnnotationsPB> - Returns:
- The T
PersistentDataclass.
-