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