public static class Edge.Builder
extends java.lang.Object
Edge.Builder
can be used to construct an Edge
little by
little.Constructor and Description |
---|
Builder(Graph.Builder.Context context,
java.lang.Object sourceNodeOrKey,
java.lang.Object targetNodeOrKey)
Constructs a new (anonymous)
Edge.Builder for the given
Graph.Builder.Context . |
Builder(Node sourceNode,
Node targetNode)
Constructs a new (anonymous) context-free
Edge.Builder , which
can only be used to construct a single edge via buildEdge() ,
i.e. which cannot be chained. |
Modifier and Type | Method and Description |
---|---|
Edge.Builder |
attr(java.lang.String key,
java.lang.Object value)
Puts the given key-value-pair into the
attributesProperty map of the
Edge which is constructed by this Edge.Builder . |
Graph |
build()
Constructs a new
Graph from the values which have been
supplied to the builder chain. |
Edge |
buildEdge()
Creates a new
Edge , setting the values specified via this
Edge.Builder . |
Edge.Builder |
edge(java.lang.Object sourceNodeOrKey,
java.lang.Object targetNodeOrKey)
Constructs a new
Edge.Builder . |
Node.Builder |
node()
Constructs a new (anonymous)
Node.Builder for a node. |
Node.Builder |
node(java.lang.Object key)
Constructs a new (identifiable)
Node.Builder for a node. |
public Builder(Graph.Builder.Context context, java.lang.Object sourceNodeOrKey, java.lang.Object targetNodeOrKey)
Edge.Builder
for the given
Graph.Builder.Context
.context
- The context in which the Edge.Builder
is used.sourceNodeOrKey
- The source Node
or a key to identify the source
Node
(or its Node.Builder
).targetNodeOrKey
- The target Node
or a key to identify the target
Node
(or its Node.Builder
).public Builder(Node sourceNode, Node targetNode)
Edge.Builder
, which
can only be used to construct a single edge via buildEdge()
,
i.e. which cannot be chained.public Edge.Builder attr(java.lang.String key, java.lang.Object value)
attributesProperty map
of the
Edge
which is constructed by this Edge.Builder
.key
- The attribute name which is inserted.value
- The attribute value which is inserted.this
for convenience.public Graph build()
Graph
from the values which have been
supplied to the builder chain.Graph
.public Edge buildEdge()
Edge
, setting the values specified via this
Edge.Builder
.Edge
.public Edge.Builder edge(java.lang.Object sourceNodeOrKey, java.lang.Object targetNodeOrKey)
Edge.Builder
.sourceNodeOrKey
- The source Node
or a key to identify the source
Node
(or its Node.Builder
).targetNodeOrKey
- The target Node
or a key to identify the target
Node
(or its Node.Builder
).Edge.Builder
.public Node.Builder node()
Node.Builder
for a node.Node.Builder
.public Node.Builder node(java.lang.Object key)
Node.Builder
for a node.key
- The key that can be used to identify the
Node.Builder
Node.Builder
.Copyright (c) 2014 itemis AG and others. All rights reserved.