Class AnnotationPointAdapter
java.lang.Object
com.inductiveautomation.historian.common.rpc.adapters.points.AnnotationPointAdapter
- All Implemented Interfaces:
BinaryAdapter<AnnotationPoint>,BinaryDeserializer<AnnotationPoint>,BinarySerializer<AnnotationPoint>
A binary adapter for serializing and deserializing
AnnotationPoint objects.
This class provides methods to encode an AnnotationPoint into a byte array
and decode a byte array back into an AnnotationPoint. It uses Protocol Buffers
for serialization and deserialization.
-
Method Summary
Modifier and TypeMethodDescriptiondecode(byte[] serialized, DeserializationContext context) Decodes a byte array into anAnnotationPointobject.byte[]encode(AnnotationPoint any, SerializationContext context) Encodes anAnnotationPointobject into a byte array.static AnnotationPointAdapterRetrieves the singleton instance of theAnnotationPointAdapter.
-
Method Details
-
getInstance
Retrieves the singleton instance of theAnnotationPointAdapter.- Returns:
- The singleton instance of
AnnotationPointAdapter.
-
decode
public AnnotationPoint decode(byte[] serialized, DeserializationContext context) throws ProtoSerializationException Decodes a byte array into anAnnotationPointobject.- Specified by:
decodein interfaceBinaryDeserializer<AnnotationPoint>- Parameters:
serialized- The byte array containing the serializedAnnotationPoint.context- TheDeserializationContextfor the operation.- Returns:
- The deserialized
AnnotationPointobject. - Throws:
ProtoSerializationException- If an error occurs during deserialization.
-
encode
public byte[] encode(AnnotationPoint any, SerializationContext context) throws ProtoSerializationException Encodes anAnnotationPointobject into a byte array.- Specified by:
encodein interfaceBinarySerializer<AnnotationPoint>- Parameters:
any- TheAnnotationPointobject to encode.context- TheSerializationContextfor the operation.- Returns:
- A byte array representing the serialized
AnnotationPoint. - Throws:
ProtoSerializationException- If an error occurs during serialization.
-