T
- The data type that the deserializer deserializes.public interface TypeDeserializer<T>
TypeSerializer
interface contains the complete set of methods for both serialization and deserialization.
The methods in this class are assumed to be stateless, such that it is effectively thread safe. Stateful implementations of the methods may lead to unpredictable side effects and will compromise both stability and correctness of the program.
Modifier and Type | Method and Description |
---|---|
boolean |
canEqual(Object obj)
Returns true if the given object can be equaled with this object.
|
T |
deserialize(DataInputView source)
De-serializes a record from the given source input view.
|
T |
deserialize(T reuse,
DataInputView source)
De-serializes a record from the given source input view into the given reuse record instance if mutable.
|
TypeSerializer<T> |
duplicate()
Creates a deep copy of this deserializer if it is necessary, i.e.
|
boolean |
equals(Object obj) |
int |
getLength()
Gets the length of the data type, if it is a fix length data type.
|
int |
hashCode() |
TypeSerializer<T> duplicate()
T deserialize(DataInputView source) throws IOException
source
- The input view from which to read the data.IOException
- Thrown, if the de-serialization encountered an I/O related error. Typically raised by the
input view, which may have an underlying I/O channel from which it reads.T deserialize(T reuse, DataInputView source) throws IOException
reuse
- The record instance into which to de-serialize the data.source
- The input view from which to read the data.IOException
- Thrown, if the de-serialization encountered an I/O related error. Typically raised by the
input view, which may have an underlying I/O channel from which it reads.int getLength()
-1
for variable length data types.boolean canEqual(Object obj)
obj
- Object which wants to take part in the equality relationCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.