public static final class Namespace.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
Namespace |
build()
Builds a
Namespace instance. |
Namespace |
build(java.lang.String friendlyName)
Builds a
Namespace instance. |
Namespace.Builder |
nextId(int id)
Sets the next Kryo registration Id for following register entries.
|
Namespace.Builder |
register(java.lang.Class<?>... expectedTypes)
Registers classes to be serialized using Kryo default serializer.
|
Namespace.Builder |
register(Namespace ns)
Registers all the class registered to given KryoNamespace.
|
Namespace.Builder |
register(com.esotericsoftware.kryo.Serializer<?> serializer,
java.lang.Class<?>... classes)
Registers serializer for the given set of classes.
|
Namespace.Builder |
setClassLoader(java.lang.ClassLoader classLoader)
Sets the namespace class loader.
|
Namespace.Builder |
setCompatible(boolean compatible)
Sets whether backwards/forwards compatible versioned serialization is enabled.
|
Namespace.Builder |
setRegistrationRequired(boolean registrationRequired)
Sets the registrationRequired flag.
|
public Namespace build(java.lang.String friendlyName)
Namespace instance.friendlyName - friendly name for the namespacepublic Namespace.Builder nextId(int id)
id - Kryo registration IdKryo.register(Class, Serializer, int)public Namespace.Builder register(java.lang.Class<?>... expectedTypes)
expectedTypes - list of classespublic Namespace.Builder register(com.esotericsoftware.kryo.Serializer<?> serializer, java.lang.Class<?>... classes)
When multiple classes are registered with an explicitly provided serializer, the namespace guarantees all instances will be serialized with the same type ID.
classes - list of classes to registerserializer - serializer to use for the classpublic Namespace.Builder register(Namespace ns)
ns - KryoNamespacepublic Namespace.Builder setClassLoader(java.lang.ClassLoader classLoader)
classLoader - the namespace class loaderpublic Namespace.Builder setCompatible(boolean compatible)
When compatible serialization is enabled, the CompatibleFieldSerializer will be set as the
default serializer for types that do not otherwise explicitly specify a serializer.
compatible - whether versioned serialization is enabledpublic Namespace.Builder setRegistrationRequired(boolean registrationRequired)
registrationRequired - Kryo's registrationRequired flagKryo.setRegistrationRequired(boolean)Copyright © 2013-2018. All Rights Reserved.