Class FunctionalSerializer<T,V>
- java.lang.Object
-
- org.wildfly.clustering.marshalling.spi.FunctionalSerializer<T,V>
-
- Type Parameters:
T- the target typeV- the mapped type
- All Implemented Interfaces:
Serializer<T>
public class FunctionalSerializer<T,V> extends Object implements Serializer<T>
A serializer that delegates to the serializer of a mapped value.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description FunctionalSerializer(Serializer<V> serializer, Function<T,V> accessor, Function<V,T> factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tread(DataInput input)Reads an object from the specified input stream.voidwrite(DataOutput output, T value)Writes the specified object to the specified output stream-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.clustering.marshalling.spi.Serializer
size
-
-
-
-
Method Detail
-
write
public void write(DataOutput output, T value) throws IOException
Description copied from interface:SerializerWrites the specified object to the specified output stream- Specified by:
writein interfaceSerializer<T>- Parameters:
output- the data output streamvalue- an object to serialize- Throws:
IOException- if an I/O error occurs
-
read
public T read(DataInput input) throws IOException
Description copied from interface:SerializerReads an object from the specified input stream.- Specified by:
readin interfaceSerializer<T>- Parameters:
input- a data input stream- Returns:
- the deserialized object
- Throws:
IOException- if an I/O error occurs
-
-