Package oracle.pgx.api
Class GraphChangeSetImpl<VID>
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.GraphBuilderImpl<VID>
-
- oracle.pgx.api.GraphChangeSetImpl<VID>
-
- All Implemented Interfaces:
GraphBuilder<VID>,GraphChangeSet<VID>
- Direct Known Subclasses:
EdgeModifierImpl,VertexModifierImpl
public class GraphChangeSetImpl<VID> extends GraphBuilderImpl<VID> implements GraphChangeSet<VID>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EdgeBuilder<VID>addEdge(long edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)Adds an edge with the given edge ID and the given source and destination vertices.EdgeBuilder<VID>addEdge(java.lang.String edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)Adds an edge with the given edge ID and the given source and destination vertices.EdgeBuilder<VID>addEdge(VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)Adds an edge with an implicit ID and the given source and destination vertices.VertexBuilder<VID>addVertex()Adds a vertex with an implicit id to the graph builder.PgxFuture<PgxGraph>buildNewSnapshotAsync()Builds a new snapshot of the graph out ofthisGraphChangeSet: the resultingPgxGraphis a new snapshot of thePgxGraphobjectthiswas created from.ChangeTypegetEdgeChangeType(java.lang.Object id)Returns theChangeTypeof the update for the edge with the given IDChangeTypegetVertexChangeType(VID id)Returns theChangeTypeof the update for the vertex with the given IDGraphChangeSet<VID>removeEdge(long edgeId)Removes an edge from the graph.GraphChangeSet<VID>removeEdge(java.lang.String edgeId)Removes an edge from the graph.GraphChangeSet<VID>removeVertex(VID vertexId)Removes a vertex from the graph.GraphChangeSet<VID>resetEdge(long edgeId)Resets any change for the edge with the given ID.GraphChangeSet<VID>resetEdge(java.lang.String edgeId)Resets any change for the edge with the given ID.GraphChangeSet<VID>resetVertex(VertexBuilder<VID> vertex)Resets any change for the given vertex.GraphChangeSet<VID>resetVertex(VID vertexId)Resets any change for the vertex with the given ID.GraphChangeSet<VID>setAddExistingEdgePolicy(OnAddExistingElement addExistingEdgePolicy)Sets the policy on what to do when an edge is added that already existsGraphChangeSet<VID>setAddExistingVertexPolicy(OnAddExistingElement addExistingVertexPolicy)Sets the policy on what to do when a vertex is added that already existsGraphChangeSet<VID>setInvalidChangePolicy(OnInvalidChange invalidChangePolicy)Sets the policy on what to do when an invalid action is addedGraphChangeSet<VID>setRequiredConversionPolicy(OnRequiredConversion requiredConversionPolicy)Sets the policy on what to do when an invalid type is encounteredjava.lang.StringtoString()EdgeModifier<VID>updateEdge(long edgeId)Returns aEdgeModifierwith which you can update edge properties and the edge label.EdgeModifier<VID>updateEdge(java.lang.String edgeId)Returns aEdgeModifierwith which you can update edge properties and the edge label.VertexModifier<VID>updateVertex(VID vertexId)Returns aVertexModifierwith which you can update vertex properties.-
Methods inherited from class oracle.pgx.api.GraphBuilderImpl
addEdge, addEdge, addEdge, addVertex, build, build, buildAsync, buildAsync, getConfigParameter, getSession, setConfigParameter, setDataSourceVersion
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface oracle.pgx.api.GraphBuilder
addEdge, build, build, buildAsync, buildAsync, getConfigParameter, setConfigParameter, setDataSourceVersion
-
Methods inherited from interface oracle.pgx.api.GraphChangeSet
addEdge, addEdge, addVertex, buildNewSnapshot, setRetainEdgeIds, setRetainIds, setRetainVertexIds
-
-
-
-
Method Detail
-
addVertex
public VertexBuilder<VID> addVertex()
Description copied from interface:GraphBuilderAdds a vertex with an implicit id to the graph builder. A builder for that vertex is returned Throws anUnsupportedOperationExceptionif vertex Id generation strategy is set toIdGenerationStrategy.USER_IDS- Specified by:
addVertexin interfaceGraphBuilder<VID>- Specified by:
addVertexin interfaceGraphChangeSet<VID>- Overrides:
addVertexin classGraphBuilderImpl<VID>- Returns:
- a vertex builder instance
-
addEdge
public EdgeBuilder<VID> addEdge(long edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)
Description copied from interface:GraphBuilderAdds 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 Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toIdGenerationStrategy.AUTO_GENERATED- Specified by:
addEdgein interfaceGraphBuilder<VID>- Specified by:
addEdgein interfaceGraphChangeSet<VID>- Overrides:
addEdgein classGraphBuilderImpl<VID>- Parameters:
edgeId- the ID of the new edgesrcVertex- aVertexBuilderImplinstance representing the source vertexdstVertex- aVertexBuilderImplinstance representing the destination vertex- Returns:
- an edge builder instance
- See Also:
VertexBuilderImpl
-
addEdge
public EdgeBuilder<VID> addEdge(java.lang.String edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)
Description copied from interface:GraphBuilderAdds 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 Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toIdGenerationStrategy.AUTO_GENERATED- Specified by:
addEdgein interfaceGraphBuilder<VID>- Specified by:
addEdgein interfaceGraphChangeSet<VID>- Overrides:
addEdgein classGraphBuilderImpl<VID>- Parameters:
edgeId- the ID of the new edgesrcVertex- aVertexBuilderImplinstance representing the source vertexdstVertex- aVertexBuilderImplinstance representing the destination vertex- Returns:
- an edge builder instance
- See Also:
VertexBuilderImpl
-
addEdge
public EdgeBuilder<VID> addEdge(VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)
Description copied from interface:GraphBuilderAdds an edge with an implicit ID and the given source and destination vertices. Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toIdGenerationStrategy.USER_IDS- Specified by:
addEdgein interfaceGraphBuilder<VID>- Overrides:
addEdgein classGraphBuilderImpl<VID>- Parameters:
srcVertex- aVertexBuilderImplinstance representing the source vertexdstVertex- aVertexBuilderImplinstance representing the destination vertex- Returns:
- an edge builder instance
- See Also:
VertexBuilderImpl
-
removeVertex
public GraphChangeSet<VID> removeVertex(VID vertexId)
Description copied from interface:GraphChangeSetRemoves a vertex from the graph. If the graph doesn't have a vertex with the given ID, an exception will be thrown once the graph is built.- Specified by:
removeVertexin interfaceGraphChangeSet<VID>- Parameters:
vertexId- the ID of the vertex to be removed- Returns:
- this graph change set
-
removeEdge
public GraphChangeSet<VID> removeEdge(long edgeId)
Description copied from interface:GraphChangeSetRemoves an edge from the graph. If the graph doesn't have an edge with the given ID, an exception will be thrown once the graph is built.- Specified by:
removeEdgein interfaceGraphChangeSet<VID>- Parameters:
edgeId- the ID of the edge to be removed- Returns:
- this graph change set
-
removeEdge
public GraphChangeSet<VID> removeEdge(java.lang.String edgeId)
Description copied from interface:GraphChangeSetRemoves an edge from the graph. If the graph doesn't have an edge with the given ID, an exception will be thrown once the graph is built.- Specified by:
removeEdgein interfaceGraphChangeSet<VID>- Parameters:
edgeId- the ID of the edge to be removed- Returns:
- this graph change set
-
updateVertex
public VertexModifier<VID> updateVertex(VID vertexId)
Description copied from interface:GraphChangeSetReturns aVertexModifierwith which you can update vertex properties. Throws an exception if the vertex has been removed with this graph change set before.- Specified by:
updateVertexin interfaceGraphChangeSet<VID>- Parameters:
vertexId- the ID of the vertex that should be updated- Returns:
- a
VertexModifierinstance
-
updateEdge
public EdgeModifier<VID> updateEdge(long edgeId)
Description copied from interface:GraphChangeSetReturns aEdgeModifierwith which you can update edge properties and the edge label.- Specified by:
updateEdgein interfaceGraphChangeSet<VID>- Parameters:
edgeId- the ID of the edge that should be updated- Returns:
- an
VertexModifierinstance
-
updateEdge
public EdgeModifier<VID> updateEdge(java.lang.String edgeId)
Description copied from interface:GraphChangeSetReturns aEdgeModifierwith which you can update edge properties and the edge label.- Specified by:
updateEdgein interfaceGraphChangeSet<VID>- Parameters:
edgeId- the ID of the edge that should be updated- Returns:
- an
VertexModifierinstance
-
resetEdge
public GraphChangeSet<VID> resetEdge(long edgeId)
Description copied from interface:GraphBuilderResets any change for the edge with the given ID. Does nothing if no change for the given edge ID exists.- Specified by:
resetEdgein interfaceGraphBuilder<VID>- Specified by:
resetEdgein interfaceGraphChangeSet<VID>- Overrides:
resetEdgein classGraphBuilderImpl<VID>- Parameters:
edgeId- the ID of the edge which should be reset- Returns:
- this graph builder
-
resetEdge
public GraphChangeSet<VID> resetEdge(java.lang.String edgeId)
Description copied from interface:GraphBuilderResets any change for the edge with the given ID. Does nothing if no change for the given edge ID exists.- Specified by:
resetEdgein interfaceGraphBuilder<VID>- Specified by:
resetEdgein interfaceGraphChangeSet<VID>- Overrides:
resetEdgein classGraphBuilderImpl<VID>- Parameters:
edgeId- the ID of the edge which should be reset- Returns:
- this graph builder
-
resetVertex
public GraphChangeSet<VID> resetVertex(VertexBuilder<VID> vertex)
Description copied from interface:GraphBuilderResets any change for the given vertex.- Specified by:
resetVertexin interfaceGraphBuilder<VID>- Specified by:
resetVertexin interfaceGraphChangeSet<VID>- Overrides:
resetVertexin classGraphBuilderImpl<VID>- Parameters:
vertex- aVertexBuilder- Returns:
- this graph builder
-
resetVertex
public GraphChangeSet<VID> resetVertex(VID vertexId)
Description copied from interface:GraphBuilderResets any change for the vertex with the given ID. Does nothing if no change for the given vertex ID exists.- Specified by:
resetVertexin interfaceGraphBuilder<VID>- Specified by:
resetVertexin interfaceGraphChangeSet<VID>- Overrides:
resetVertexin classGraphBuilderImpl<VID>- Parameters:
vertexId- the ID of the vertex which should be reset- Returns:
- this graph builder
-
setAddExistingEdgePolicy
public GraphChangeSet<VID> setAddExistingEdgePolicy(OnAddExistingElement addExistingEdgePolicy)
Description copied from interface:GraphChangeSetSets the policy on what to do when an edge is added that already exists- Specified by:
setAddExistingEdgePolicyin interfaceGraphChangeSet<VID>- Parameters:
addExistingEdgePolicy- the new policy- Returns:
- this graph builder
-
setAddExistingVertexPolicy
public GraphChangeSet<VID> setAddExistingVertexPolicy(OnAddExistingElement addExistingVertexPolicy)
Description copied from interface:GraphChangeSetSets the policy on what to do when a vertex is added that already exists- Specified by:
setAddExistingVertexPolicyin interfaceGraphChangeSet<VID>- Parameters:
addExistingVertexPolicy- the new policy- Returns:
- this graph builder
-
setInvalidChangePolicy
public GraphChangeSet<VID> setInvalidChangePolicy(OnInvalidChange invalidChangePolicy)
Description copied from interface:GraphChangeSetSets the policy on what to do when an invalid action is added- Specified by:
setInvalidChangePolicyin interfaceGraphChangeSet<VID>- Returns:
- this graph builder
-
setRequiredConversionPolicy
public GraphChangeSet<VID> setRequiredConversionPolicy(OnRequiredConversion requiredConversionPolicy)
Description copied from interface:GraphChangeSetSets the policy on what to do when an invalid type is encountered- Specified by:
setRequiredConversionPolicyin interfaceGraphChangeSet<VID>- Returns:
- this graph builder
-
toString
public java.lang.String toString()
- Overrides:
toStringin classGraphBuilderImpl<VID>
-
buildNewSnapshotAsync
public final PgxFuture<PgxGraph> buildNewSnapshotAsync()
Description copied from interface:GraphChangeSetBuilds a new snapshot of the graph out ofthisGraphChangeSet: the resultingPgxGraphis a new snapshot of thePgxGraphobjectthiswas created from.- Specified by:
buildNewSnapshotAsyncin interfaceGraphChangeSet<VID>- Returns:
- the
PgxFutureto retrieve a newPgxGraphobject with the same name of the original graph and the changes added intothis; the newPgxGraphis a new snapshot of the original graph
-
getVertexChangeType
public ChangeType getVertexChangeType(VID id)
Description copied from interface:GraphChangeSetReturns theChangeTypeof the update for the vertex with the given ID- Specified by:
getVertexChangeTypein interfaceGraphChangeSet<VID>- Parameters:
id- the ID of the vertex that should be referenced- Returns:
- the
ChangeTypeor null if the graph doesn't have an vertex with the given ID
-
getEdgeChangeType
public ChangeType getEdgeChangeType(java.lang.Object id)
Description copied from interface:GraphChangeSetReturns theChangeTypeof the update for the edge with the given ID- Specified by:
getEdgeChangeTypein interfaceGraphChangeSet<VID>- Parameters:
id- the ID of the edge that should be referenced- Returns:
- the
ChangeTypeor null if the graph doesn't have an edge with the given ID
-
-