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 anAnnotationQueryKeyobject.byte[]encode(AnnotationQueryKey any, SerializationContext context) Encodes anAnnotationQueryKeyobject into a byte array.static AnnotationQueryKeyAdapterRetrieves 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 anAnnotationQueryKeyobject.- Specified by:
decodein interfaceBinaryDeserializer<AnnotationQueryKey>- Parameters:
serialized- The byte array containing the serializedAnnotationQueryKey.context- TheDeserializationContextfor the operation.- Returns:
- The deserialized
AnnotationQueryKeyobject. - Throws:
ProtoSerializationException- If an error occurs during deserialization.
-
encode
public byte[] encode(AnnotationQueryKey any, SerializationContext context) throws ProtoSerializationException Encodes anAnnotationQueryKeyobject into a byte array.- Specified by:
encodein interfaceBinarySerializer<AnnotationQueryKey>- Parameters:
any- TheAnnotationQueryKeyobject to encode.context- TheSerializationContextfor the operation.- Returns:
- A byte array representing the serialized
AnnotationQueryKey. - Throws:
ProtoSerializationException- If an error occurs during serialization.
-