@NotThreadSafe public static final class ImmutableGraph.Builder extends Object
ImmutableGraph.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
| Modifier and Type | Method and Description |
|---|---|
ImmutableGraph |
build()
Builds a new
ImmutableGraph. |
ImmutableGraph.Builder |
from(Graph instance)
Fill a builder with attribute values from the provided
Graph instance. |
ImmutableGraph.Builder |
setEdges(Collection<Edge> edges)
Initializes the value for the
edges attribute. |
ImmutableGraph.Builder |
setIncomplete(boolean incomplete)
Initializes the optional value
incomplete to incomplete. |
ImmutableGraph.Builder |
setIncomplete(Optional<Boolean> incomplete)
Initializes the optional value
incomplete to incomplete. |
ImmutableGraph.Builder |
setNodes(Collection<Node> nodes)
Initializes the value for the
nodes attribute. |
@CanIgnoreReturnValue public final ImmutableGraph.Builder from(Graph instance)
Graph instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableGraph.Builder setNodes(Collection<Node> nodes)
nodes attribute.nodes - The value for nodesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableGraph.Builder setEdges(Collection<Edge> edges)
edges attribute.edges - The value for edgesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableGraph.Builder setIncomplete(boolean incomplete)
incomplete to incomplete.incomplete - The value for incompletethis builder for chained invocation@CanIgnoreReturnValue public final ImmutableGraph.Builder setIncomplete(Optional<Boolean> incomplete)
incomplete to incomplete.incomplete - The value for incompletethis builder for use in a chained invocationpublic ImmutableGraph build()
ImmutableGraph.IllegalStateException - if any required attributes are missingCopyright © 2024 Atlassian. All rights reserved.