Class AnnotationQueryKeyAdapter
java.lang.Object
com.inductiveautomation.historian.common.rpc.adapters.query.AnnotationQueryKeyAdapter
- All Implemented Interfaces:
BinaryAdapter<AnnotationQueryKey>
,BinaryDeserializer<AnnotationQueryKey>
,BinarySerializer<AnnotationQueryKey>
A binary adapter for serializing and deserializing
AnnotationQueryKey
objects.
This class provides methods to encode an AnnotationQueryKey
into a byte array
and decode a byte array back into an AnnotationQueryKey
. It uses Protocol Buffers
for serialization and deserialization.
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(byte[] serialized, DeserializationContext context) Decodes a byte array into anAnnotationQueryKey
object.byte[]
encode
(AnnotationQueryKey any, SerializationContext context) Encodes anAnnotationQueryKey
object into a byte array.static AnnotationQueryKeyAdapter
Retrieves the singleton instance of theAnnotationQueryKeyAdapter
.
-
Method Details
-
getInstance
Retrieves the singleton instance of theAnnotationQueryKeyAdapter
.- Returns:
- The singleton instance of
AnnotationQueryKeyAdapter
.
-
decode
public AnnotationQueryKey decode(byte[] serialized, DeserializationContext context) throws ProtoSerializationException Decodes a byte array into anAnnotationQueryKey
object.- Specified by:
decode
in interfaceBinaryDeserializer<AnnotationQueryKey>
- Parameters:
serialized
- The byte array containing the serializedAnnotationQueryKey
.context
- TheDeserializationContext
for the operation.- Returns:
- The deserialized
AnnotationQueryKey
object. - Throws:
ProtoSerializationException
- If an error occurs during deserialization.
-
encode
public byte[] encode(AnnotationQueryKey any, SerializationContext context) throws ProtoSerializationException Encodes anAnnotationQueryKey
object into a byte array.- Specified by:
encode
in interfaceBinarySerializer<AnnotationQueryKey>
- Parameters:
any
- TheAnnotationQueryKey
object to encode.context
- TheSerializationContext
for the operation.- Returns:
- A byte array representing the serialized
AnnotationQueryKey
. - Throws:
ProtoSerializationException
- If an error occurs during serialization.
-