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.Builder
add(Class<DT> type, TypeSerializer<DT> serializer)
Adds a serializer for a built-in type.<DT> TypeSerializerRegistry.Builder
addCustomType(Class<DT> type, CustomTypeSerializer<DT> serializer)
Adds a serializer for a custom type.TypeSerializerRegistry.Builder
addRegistry(IoRegistry registry)
AddCustomTypeSerializer
by way of anIoRegistry
.TypeSerializerRegistry
create()
Creates a newTypeSerializerRegistry
instance based on the serializers added.TypeSerializerRegistry.Builder
withFallbackResolver(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.,VertexProperty
beforeProperty
.
-
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)
AddCustomTypeSerializer
by way of anIoRegistry
. The registry entries should be bound toGraphBinaryIo
.
-
create
public TypeSerializerRegistry create()
Creates a newTypeSerializerRegistry
instance based on the serializers added.
-
-