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