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