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

## Class GraphSONWriter.Builder

- java.lang.Object
- - org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter.Builder

- All Implemented Interfaces:
    GraphWriter.WriterBuilder<GraphSONWriter>
  Enclosing class:
    GraphSONWriter

      public static class GraphSONWriter.Builder
      extends Object
      implements GraphWriter.WriterBuilder<GraphSONWriter>

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `GraphSONWriter` | `create()` Creates the `GraphWriter` implementation given options provided to the `GraphWriter.WriterBuilder` implementation.
    `GraphSONWriter.Builder` | `mapper(Mapper<ObjectMapper> mapper)` Override all of the builder options with this mapper.
    `GraphSONWriter.Builder` | `wrapAdjacencyList(boolean wrapAdjacencyListInObject)` Wraps the output of `GraphWriter.writeGraph(OutputStream, Graph)`, `GraphWriter.writeVertices(OutputStream, Iterator)` and `GraphWriter.writeVertices(OutputStream, Iterator, Direction)` in a JSON object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### mapper

          public GraphSONWriter.Builder mapper(Mapper<ObjectMapper> mapper)

      Override all of the builder options with this mapper. If this value is set to something other than null then that value will be used to construct the writer.

    - #### wrapAdjacencyList

          public GraphSONWriter.Builder wrapAdjacencyList(boolean wrapAdjacencyListInObject)

      Wraps the output of `GraphWriter.writeGraph(OutputStream, Graph)`, `GraphWriter.writeVertices(OutputStream, Iterator)` and `GraphWriter.writeVertices(OutputStream, Iterator, Direction)` in a JSON object. By default, this value is `false` which means that the output is such that there is one JSON object (vertex) per line. When `true` the line breaks are not written and instead a valid JSON object is formed where the vertices are part of a JSON array in a key called "vertices".

      By setting this value to `true`, the generated JSON is no longer "splittable" by line and thus not suitable for OLAP processing. Furthermore, reading this format of the JSON with `GraphSONReader.readGraph(InputStream, Graph)` or `GraphSONReader.readVertices(InputStream, Function, Function, Direction)` requires that the entire JSON object be read into memory, so it is best saved for "small" graphs.

    - #### create

          public GraphSONWriter create()

      Description copied from interface: `GraphWriter.WriterBuilder`
      Creates the `GraphWriter` implementation given options provided to the `GraphWriter.WriterBuilder` implementation.
      Specified by:
        `create` in interface `GraphWriter.WriterBuilder<GraphSONWriter>`

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