Class TypeSerializerRegistry.Builder
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.structure.io.binary.TypeSerializerRegistry.Builder
-
- Enclosing class:
- TypeSerializerRegistry
public static class TypeSerializerRegistry.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <DT> TypeSerializerRegistry.Builderadd(Class<DT> type, TypeSerializer<DT> serializer)Adds a serializer for a built-in type.<DT> TypeSerializerRegistry.BuilderaddCustomType(Class<DT> type, CustomTypeSerializer<DT> serializer)Adds a serializer for a custom type.TypeSerializerRegistry.BuilderaddRegistry(IoRegistry registry)AddCustomTypeSerializerby way of anIoRegistry.TypeSerializerRegistrycreate()Creates a newTypeSerializerRegistryinstance based on the serializers added.TypeSerializerRegistry.BuilderwithFallbackResolver(Function<Class<?>,TypeSerializer<?>> fallbackResolver)Provides a way to resolve the type serializer to use when there isn't any direct match.
-
-
-
Method Detail
-
add
public <DT> TypeSerializerRegistry.Builder add(Class<DT> type, TypeSerializer<DT> serializer)
Adds a serializer for a built-in type.Note that when providing a serializer for an Interface (
VertexProperty,Property,Vertex, ...), the serializer resolution from the registry will be defined by the order that it was provided. In this case, you should provide the type serializer starting from most specific to less specific or to put it in other words, start from derived types and then parent types, e.g.,VertexPropertybeforeProperty.
-
addCustomType
public <DT> TypeSerializerRegistry.Builder addCustomType(Class<DT> type, CustomTypeSerializer<DT> serializer)
Adds a serializer for a custom type.
-
withFallbackResolver
public TypeSerializerRegistry.Builder withFallbackResolver(Function<Class<?>,TypeSerializer<?>> fallbackResolver)
Provides a way to resolve the type serializer to use when there isn't any direct match.
-
addRegistry
public TypeSerializerRegistry.Builder addRegistry(IoRegistry registry)
AddCustomTypeSerializerby way of anIoRegistry. The registry entries should be bound toGraphBinaryIo.
-
create
public TypeSerializerRegistry create()
Creates a newTypeSerializerRegistryinstance based on the serializers added.
-
-