Class GraphSONMapper.Builder
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper.Builder
-
- All Implemented Interfaces:
Mapper.Builder<GraphSONMapper.Builder>
- Enclosing class:
- GraphSONMapper
public static class GraphSONMapper.Builder extends Object implements Mapper.Builder<GraphSONMapper.Builder>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphSONMapper.Builder
addCustomModule(org.apache.tinkerpop.shaded.jackson.databind.module.SimpleModule custom)
Supply a mapper module for serialization/deserialization.GraphSONMapper.Builder
addDefaultXModule(boolean includeDefaultXModule)
Supply a default extension module of V2_0 and V3_0 for serialization/deserialization.GraphSONMapper.Builder
addRegistry(IoRegistry registry)
Adds a vendor suppliedIoRegistry
to theMapper.Builder
which enables it to check for vendor custom serializers to add to theMapper
.GraphSONMapper
create()
GraphSONMapper.Builder
loadCustomModules(boolean loadCustomModules)
Try to loadSimpleModule
instances from the current classpath.GraphSONMapper.Builder
normalize(boolean normalize)
Forces keys to be sorted.GraphSONMapper.Builder
typeInfo(TypeInfo typeInfo)
Specify if the values are going to be typed or not, and at which level.GraphSONMapper.Builder
version(String version)
Set the version of GraphSON to use.GraphSONMapper.Builder
version(GraphSONVersion version)
Set the version of GraphSON to use.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.structure.io.Mapper.Builder
addRegistries
-
-
-
-
Method Detail
-
addRegistry
public GraphSONMapper.Builder addRegistry(IoRegistry registry)
Adds a vendor suppliedIoRegistry
to theMapper.Builder
which enables it to check for vendor custom serializers to add to theMapper
. AllIo
implementations should expose this method via thisMapper.Builder
so that it is compatible withGraph.io(org.apache.tinkerpop.gremlin.structure.io.Io.Builder<I>)
. Successive calls to this method will add multiple registries. Registry order must be respected when doing so. In other words, data written withIoRegistry
A
added first andB
second must be read by aMapper
with that same registry ordering. Attempting to addB
beforeA
will result in errors.- Specified by:
addRegistry
in interfaceMapper.Builder<GraphSONMapper.Builder>
-
version
public GraphSONMapper.Builder version(GraphSONVersion version)
Set the version of GraphSON to use. The default isGraphSONVersion.V3_0
.
-
version
public GraphSONMapper.Builder version(String version)
Set the version of GraphSON to use.
-
addCustomModule
public GraphSONMapper.Builder addCustomModule(org.apache.tinkerpop.shaded.jackson.databind.module.SimpleModule custom)
Supply a mapper module for serialization/deserialization.
-
addDefaultXModule
public GraphSONMapper.Builder addDefaultXModule(boolean includeDefaultXModule)
Supply a default extension module of V2_0 and V3_0 for serialization/deserialization.
-
loadCustomModules
public GraphSONMapper.Builder loadCustomModules(boolean loadCustomModules)
Try to loadSimpleModule
instances from the current classpath. These are loaded in addition to the one supplied to theaddCustomModule(SimpleModule)
;
-
normalize
public GraphSONMapper.Builder normalize(boolean normalize)
Forces keys to be sorted.
-
typeInfo
public GraphSONMapper.Builder typeInfo(TypeInfo typeInfo)
Specify if the values are going to be typed or not, and at which level. The level can beTypeInfo.NO_TYPES
orTypeInfo.PARTIAL_TYPES
, and could be extended in the future.
-
create
public GraphSONMapper create()
-
-