Class GraphBuilderImpl<VID>

    • Method Detail

      • setDataSourceVersion

        public void setDataSourceVersion​(java.lang.String version)
        Description copied from interface: GraphBuilder
        Sets the version information for the built graph or snapshot
        Specified by:
        setDataSourceVersion in interface GraphBuilder<VID>
        Parameters:
        version - the version information
      • addVertex

        public VertexBuilder<VID> addVertex​(VID vertexId)
        Description copied from interface: GraphBuilder
        Adds the vertex with the given id to the graph builder. If the vertex doesn't exist it is added, if it exists a builder for that vertex is returned Throws an UnsupportedOperationException if vertex Id generation strategy is set to IdGenerationStrategy.AUTO_GENERATED
        Specified by:
        addVertex in interface GraphBuilder<VID>
        Parameters:
        vertexId - the ID of the new vertex
        Returns:
        a vertex builder instance
      • resetVertex

        public GraphBuilder<VID> resetVertex​(VID vertexId)
        Description copied from interface: GraphBuilder
        Resets any change for the vertex with the given ID. Does nothing if no change for the given vertex ID exists.
        Specified by:
        resetVertex in interface GraphBuilder<VID>
        Parameters:
        vertexId - the ID of the vertex which should be reset
        Returns:
        this graph builder
      • resetEdge

        public GraphBuilder<VID> resetEdge​(long edgeId)
        Description copied from interface: GraphBuilder
        Resets any change for the edge with the given ID. Does nothing if no change for the given edge ID exists.
        Specified by:
        resetEdge in interface GraphBuilder<VID>
        Parameters:
        edgeId - the ID of the edge which should be reset
        Returns:
        this graph builder
      • resetEdge

        public GraphBuilder<VID> resetEdge​(java.lang.String edgeId)
        Description copied from interface: GraphBuilder
        Resets any change for the edge with the given ID. Does nothing if no change for the given edge ID exists.
        Specified by:
        resetEdge in interface GraphBuilder<VID>
        Parameters:
        edgeId - the ID of the edge which should be reset
        Returns:
        this graph builder
      • addEdge

        public EdgeBuilder<VID> addEdge​(long edgeId,
                                        VID srcVertex,
                                        VID dstVertex)
        Description copied from interface: GraphBuilder
        Adds an edge with the given edge ID and the given source and destination vertices. If the edge doesn't exist it is added, if it exists a builder for that edge is returned Vertices that don't yet exist in the graph are added on the fly. Throws an UnsupportedOperationException if edge Id generation strategy is set to IdGenerationStrategy.AUTO_GENERATED
        Specified by:
        addEdge in interface GraphBuilder<VID>
        Parameters:
        edgeId - the ID of the new edge
        srcVertex - the source ID of the new edge
        dstVertex - the destination ID of the new edge
        Returns:
        an edge builder instance
      • addEdge

        public EdgeBuilder<VID> addEdge​(java.lang.String edgeId,
                                        VID srcVertex,
                                        VID dstVertex)
        Description copied from interface: GraphBuilder
        Adds an edge with the given edge ID and the given source and destination vertices. If the edge doesn't exist it is added, if it exists a builder for that edge is returned Vertices that don't yet exist in the graph are added on the fly. Throws an UnsupportedOperationException if edge Id generation strategy is set to IdGenerationStrategy.AUTO_GENERATED
        Specified by:
        addEdge in interface GraphBuilder<VID>
        Parameters:
        edgeId - the ID of the new edge
        srcVertex - the source ID of the new edge
        dstVertex - the destination ID of the new edge
        Returns:
        an edge builder instance
      • addEdge

        public EdgeBuilder<VID> addEdge​(VID srcVertex,
                                        VID dstVertex)
        Description copied from interface: GraphBuilder
        Adds an edge with an implicit ID and the given source and destination vertices. Vertices that don't yet exist in the graph are added on the fly. Throws an UnsupportedOperationException if edge Id generation strategy is set to IdGenerationStrategy.USER_IDS
        Specified by:
        addEdge in interface GraphBuilder<VID>
        Parameters:
        srcVertex - the source ID of the new edge
        dstVertex - the destination ID of the new edge
        Returns:
        an edge builder instance
      • buildAsync

        public final PgxFuture<PgxGraph> buildAsync​(java.lang.String newGraphName)
        Description copied from interface: GraphBuilder
        Builds a new graph out of the changes in this graph builder
        Specified by:
        buildAsync in interface GraphBuilder<VID>
        Parameters:
        newGraphName - the new name of the graph. If null a name is generated
        Returns:
        a new graph
      • setConfigParameter

        public void setConfigParameter​(GraphBuilderConfig.Field parameter,
                                       java.lang.Object value)
        Description copied from interface: GraphBuilder
        Set the given configuration parameter to the given value
        Specified by:
        setConfigParameter in interface GraphBuilder<VID>
        Parameters:
        parameter - the config parameter to set
        value - the new value for the config parameter
      • getConfigParameter

        public java.lang.Object getConfigParameter​(GraphBuilderConfig.Field parameter)
        Description copied from interface: GraphBuilder
        Retrieve the value for the given config parameter
        Specified by:
        getConfigParameter in interface GraphBuilder<VID>
        Parameters:
        parameter - the config parameter to get the value for
        Returns:
        the value for the given config parameter
      • build

        public final PgxGraph build​(java.lang.String newGraphName)
                             throws java.util.concurrent.ExecutionException,
                                    java.lang.InterruptedException
        Description copied from interface: GraphBuilder
        Blocking version of GraphBuilder.buildAsync(String). Calls GraphBuilder.buildAsync(String) and waits for the returned PgxFuture to complete.
        Specified by:
        build in interface GraphBuilder<VID>
        Throws:
        java.util.concurrent.ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.
        java.lang.InterruptedException - if the caller thread gets interrupted while waiting for completion.
      • build

        public final PgxGraph build()
                             throws java.util.concurrent.ExecutionException,
                                    java.lang.InterruptedException
        Description copied from interface: GraphBuilder
        Blocking version of GraphBuilder.buildAsync(). Calls GraphBuilder.buildAsync() and waits for the returned PgxFuture to complete.
        Specified by:
        build in interface GraphBuilder<VID>
        Throws:
        java.util.concurrent.ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.
        java.lang.InterruptedException - if the caller thread gets interrupted while waiting for completion.
      • getSession

        public final PgxSession getSession()
        Gets the session.
        Returns:
        the session this graph builder belongs to
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object