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 aQualityCodeobject.byte[]encode(QualityCode any, SerializationContext context) Encodes aQualityCodeobject into a byte array.static QualityCodeAdapterRetrieves 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 aQualityCodeobject.- Specified by:
decodein interfaceBinaryDeserializer<QualityCode>- Parameters:
serialized- The byte array containing the serializedQualityCode.context- TheDeserializationContextfor the operation.- Returns:
- The deserialized
QualityCodeobject. - Throws:
ProtoSerializationException- If an error occurs during deserialization.
-
encode
Encodes aQualityCodeobject into a byte array.- Specified by:
encodein interfaceBinarySerializer<QualityCode>- Parameters:
any- TheQualityCodeobject to encode.context- TheSerializationContextfor the operation.- Returns:
- A byte array representing the serialized
QualityCode.
-