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