public static interface GryoMapper.Builder
Modifier and Type | Method and Description |
---|---|
GryoMapper.Builder |
addCustom(Class... custom)
Add mapper classes to serializes with gryo using standard serialization.
|
GryoMapper.Builder |
addCustom(Class clazz,
Function<Kryo,Serializer> serializer)
Add mapper class to serializes with mapper serialization as returned from a
Function . |
GryoMapper.Builder |
addCustom(Class clazz,
Serializer serializer)
Add mapper class to serializes with mapper serialization.
|
GryoMapper.Builder |
compliant(BiPredicate<Byte,Byte> compliant)
By default the
extendedVersion(byte) is checked against what is read from an input source and if
those values are equal the version being read is considered "compliant". |
GryoMapper |
create() |
GryoMapper.Builder |
extendedVersion(byte extendedVersion)
If using mapper classes it might be useful to tag the version stamped to the serialization with a mapper
value, such that Gryo serialization at 1.0.0 would have a fourth byte for an extended version.
|
GryoMapper.Builder addCustom(Class... custom)
GryoMapper.Builder addCustom(Class clazz, Serializer serializer)
GryoMapper.Builder addCustom(Class clazz, Function<Kryo,Serializer> serializer)
Function
.GryoMapper.Builder extendedVersion(byte extendedVersion)
Byte.MIN_VALUE
. The value supplied here should be greater
than or equal to zero.GryoMapper.Builder compliant(BiPredicate<Byte,Byte> compliant)
extendedVersion(byte)
is checked against what is read from an input source and if
those values are equal the version being read is considered "compliant". To alter this behavior, supply a
mapper compliance Predicate
to evaluate the value read from the input source (i.e. first argument)
and the value marked in the GryoMapper
instance {i.e. second argument}. Supplying this function is
useful when versions require backward compatibility or other more complex checks. This function is only used
if the extendedVersion(byte)
is set to something other than its default.GryoMapper create()
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.