org.apache.tinkerpop.gremlin.structure.io.graphson

## 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 Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `GraphSONMapper.Builder` | `addCustomModule(SimpleModule custom)` Supply a mapper module for serialization/deserialization.
    `GraphSONMapper.Builder` | `addRegistry(IoRegistry registry)` Adds a vendor supplied `IoRegistry` to the `Mapper.Builder` which enables it to check for vendor custom serializers to add to the `Mapper`.
    `GraphSONMapper` | `create()`
    `GraphSONMapper.Builder` | `embedTypes(boolean embedTypes)` Deprecated. As of release 3.2.1, replaced by `typeInfo(TypeInfo)`.
    `GraphSONMapper.Builder` | `loadCustomModules(boolean loadCustomModules)` Try to load `SimpleModule` 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(GraphSONVersion version)` Set the version of GraphSON to use.
    `GraphSONMapper.Builder` | `version(String 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`

- - ### Method Detail

    - #### addRegistry

          public GraphSONMapper.Builder addRegistry(IoRegistry registry)

      Adds a vendor supplied `IoRegistry` to the `Mapper.Builder` which enables it to check for vendor custom serializers to add to the `Mapper`. All `Io` implementations should expose this method via this `Mapper.Builder` so that it is compatible with `Graph.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 with `IoRegistry` `A` added first and `B` second must be read by a `Mapper` with that same registry ordering. Attempting to add `B` before `A` will result in errors.
      Specified by:
        `addRegistry` in interface `Mapper.Builder<GraphSONMapper.Builder>`

    - #### version

          public GraphSONMapper.Builder version(GraphSONVersion version)

      Set the version of GraphSON to use. The default is `GraphSONVersion.V1_0`.

    - #### version

          public GraphSONMapper.Builder version(String version)

      Set the version of GraphSON to use.

    - #### addCustomModule

          public GraphSONMapper.Builder addCustomModule(SimpleModule custom)

      Supply a mapper module for serialization/deserialization.

    - #### loadCustomModules

          public GraphSONMapper.Builder loadCustomModules(boolean loadCustomModules)

      Try to load `SimpleModule` instances from the current classpath. These are loaded in addition to the one supplied to the `addCustomModule(SimpleModule)`;

    - #### normalize

          public GraphSONMapper.Builder normalize(boolean normalize)

      Forces keys to be sorted.

    - #### embedTypes

          @Deprecated
          public GraphSONMapper.Builder embedTypes(boolean embedTypes)

      Deprecated. As of release 3.2.1, replaced by `typeInfo(TypeInfo)`.
      Embeds Java types into generated JSON to clarify their origins. Setting this value will override the value of `typeInfo(TypeInfo)` where true will set it to `TypeInfo.PARTIAL_TYPES` and false will set it to `TypeInfo.NO_TYPES`.

    - #### typeInfo

          public GraphSONMapper.Builder typeInfo(TypeInfo typeInfo)

      Specify if the values are going to be typed or not, and at which level. Setting this value will override the value of `embedTypes(boolean)` where `TypeInfo.PARTIAL_TYPES` will set it to true and `TypeInfo.NO_TYPES` will set it to false. The level can be `TypeInfo.NO_TYPES` or `TypeInfo.PARTIAL_TYPES`, and could be extended in the future.

    - #### create

          public GraphSONMapper create()

Copyright © 2013–2019 Apache Software Foundation. All rights reserved.