public static class GryoMapper.BuilderV1d0 extends Object implements GryoMapper.Builder
Constructor and Description |
---|
BuilderV1d0() |
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.
|
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
GryoMapper.Builder.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.
|
public GryoMapper.Builder addCustom(Class... custom)
addCustom
in interface GryoMapper.Builder
public GryoMapper.Builder addCustom(Class clazz, Serializer serializer)
addCustom
in interface GryoMapper.Builder
public GryoMapper.Builder addCustom(Class clazz, Function<Kryo,Serializer> serializer)
addCustom
in interface GryoMapper.Builder
public GryoMapper.Builder extendedVersion(byte extendedVersion)
Byte.MIN_VALUE
. The value supplied here should be greater
than or equal to zero.extendedVersion
in interface GryoMapper.Builder
public GryoMapper.Builder compliant(BiPredicate<Byte,Byte> compliant)
GryoMapper.Builder.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 GryoMapper.Builder.extendedVersion(byte)
is set to something other than its default.compliant
in interface GryoMapper.Builder
public GryoMapper create()
create
in interface GryoMapper.Builder
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.