public abstract class CaseClassSerializer<T extends scala.Product> extends TupleSerializerBase<T> implements scala.Cloneable
arity, fieldSerializers, tupleClass
Constructor and Description |
---|
CaseClassSerializer(Class<T> clazz,
TypeSerializer<?>[] scalaFieldSerializers) |
Modifier and Type | Method and Description |
---|---|
protected Object |
clone() |
T |
copy(T from)
Creates a deep copy of the given element in a new element.
|
T |
copy(T from,
T reuse)
Creates a copy from the given element.
|
T |
createInstance()
Creates a new instance of the data type.
|
T |
createOrReuseInstance(Object[] fields,
T reuse) |
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.
|
CaseClassSerializer<T> |
duplicate()
Creates a deep copy of this serializer if it is necessary, i.e.
|
Object[] |
fields() |
void |
initArray() |
boolean |
instanceCreationFailed() |
void |
serialize(T value,
DataOutputView target)
Serializes the given record to the given target output view.
|
canEqual, copy, createInstance, equals, getArity, getLength, getTupleClass, hashCode, isImmutableType
isCompatibleWith
public CaseClassSerializer(Class<T> clazz, TypeSerializer<?>[] scalaFieldSerializers)
public Object[] fields()
public boolean instanceCreationFailed()
public CaseClassSerializer<T> duplicate()
TypeSerializer
duplicate
in class TypeSerializer<T extends scala.Product>
public T createInstance()
TypeSerializer
createInstance
in class TypeSerializer<T extends scala.Product>
public T createOrReuseInstance(Object[] fields, T reuse)
createOrReuseInstance
in class TupleSerializerBase<T extends scala.Product>
public T copy(T from, T reuse)
TypeSerializer
copy
in class TypeSerializer<T extends scala.Product>
from
- The element to be copied.reuse
- The element to be reused. May or may not be used.public T copy(T from)
TypeSerializer
copy
in class TypeSerializer<T extends scala.Product>
from
- The element reuse be copied.public void serialize(T value, DataOutputView target)
TypeSerializer
serialize
in class TypeSerializer<T extends scala.Product>
value
- The record to serialize.target
- The output view to write the serialized data to.public T deserialize(T reuse, DataInputView source)
TypeSerializer
deserialize
in class TypeSerializer<T extends scala.Product>
reuse
- The record instance into which to de-serialize the data.source
- The input view from which to read the data.public T deserialize(DataInputView source)
TypeSerializer
deserialize
in class TypeSerializer<T extends scala.Product>
source
- The input view from which to read the data.public void initArray()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.