public static final class ImmutableLoop.Builder<V,E> extends Object
ImmutableLoop.
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 |
|---|---|
ImmutableLoop.Builder<V,E> |
addAllEdges(Iterable<? extends Edge<V,E>> elements)
Adds elements to
edges set. |
ImmutableLoop.Builder<V,E> |
addEdges(Edge<V,E>... elements)
Adds elements to
edges set. |
ImmutableLoop.Builder<V,E> |
addEdges(Edge<V,E> element)
Adds one element to
edges set. |
ImmutableLoop<V,E> |
build()
Builds a new
ImmutableLoop. |
ImmutableLoop.Builder<V,E> |
edges(Iterable<? extends Edge<V,E>> elements)
Sets or replaces all elements for
edges set. |
ImmutableLoop.Builder<V,E> |
from(Loop<V,E> instance)
Fill a builder with attribute values from the provided
Loop instance. |
public final ImmutableLoop.Builder<V,E> from(Loop<V,E> instance)
Loop instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.
Collection elements and entries will be added, not replaced.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ImmutableLoop.Builder<V,E> addEdges(Edge<V,E> element)
edges set.element - A edges elementthis builder for use in a chained invocation@SafeVarargs public final ImmutableLoop.Builder<V,E> addEdges(Edge<V,E>... elements)
edges set.elements - An array of edges elementsthis builder for use in a chained invocationpublic final ImmutableLoop.Builder<V,E> edges(Iterable<? extends Edge<V,E>> elements)
edges set.elements - An iterable of edges elementsthis builder for use in a chained invocationpublic final ImmutableLoop.Builder<V,E> addAllEdges(Iterable<? extends Edge<V,E>> elements)
edges set.elements - An iterable of edges elementsthis builder for use in a chained invocationpublic ImmutableLoop<V,E> build()
ImmutableLoop.IllegalStateException - if any required attributes are missingCopyright © 2022. All rights reserved.