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 GraphSONWritercreate()Creates theGraphWriterimplementation given options provided to theGraphWriter.WriterBuilderimplementation.GraphSONWriter.Buildermapper(Mapper<org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper> mapper)Override all of the builder options with this mapper.GraphSONWriter.BuilderwrapAdjacencyList(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 isfalsewhich means that the output is such that there is one JSON object (vertex) per line. Whentruethe 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.WriterBuilderCreates theGraphWriterimplementation given options provided to theGraphWriter.WriterBuilderimplementation.- Specified by:
createin interfaceGraphWriter.WriterBuilder<GraphSONWriter>
-
-