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