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 Description GraphSONWriter
create()
Creates theGraphWriter
implementation given options provided to theGraphWriter.WriterBuilder
implementation.GraphSONWriter.Builder
mapper(Mapper<org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper> mapper)
Override all of the builder options with this mapper.GraphSONWriter.Builder
wrapAdjacencyList(boolean wrapAdjacencyListInObject)
Wraps the output ofGraphWriter.writeGraph(OutputStream, Graph)
,GraphWriter.writeVertices(OutputStream, Iterator)
andGraphWriter.writeVertices(OutputStream, Iterator, Direction)
in a JSON object.
-
-
-
Method Detail
-
mapper
public GraphSONWriter.Builder mapper(Mapper<org.apache.tinkerpop.shaded.jackson.databind.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 ofGraphWriter.writeGraph(OutputStream, Graph)
,GraphWriter.writeVertices(OutputStream, Iterator)
andGraphWriter.writeVertices(OutputStream, Iterator, Direction)
in a JSON object. By default, this value isfalse
which means that the output is such that there is one JSON object (vertex) per line. Whentrue
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 totrue
, the generated JSON is no longer "splittable" by line and thus not suitable for OLAP processing. Furthermore, reading this format of the JSON withGraphSONReader.readGraph(InputStream, Graph)
orGraphSONReader.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 theGraphWriter
implementation given options provided to theGraphWriter.WriterBuilder
implementation.- Specified by:
create
in interfaceGraphWriter.WriterBuilder<GraphSONWriter>
-
-