E - the type of the Bag's elements.public static final class ImmutableBag.Builder<E> extends Object
ImmutableBag builder. Not thread-safe.| Constructor and Description |
|---|
ImmutableBag.Builder() |
| Modifier and Type | Method and Description |
|---|---|
ImmutableBag.Builder<E> |
add(E... values)
Adds the given values to the
Bag being built. |
ImmutableBag.Builder<E> |
add(Iterable<? extends E> values)
Adds all the values contained in the given
Iterable
to the Bag being built. |
ImmutableBag.Builder<E> |
add(Iterator<? extends E> values)
Adds all the values contained in the given
Iterator
to the Bag being built. |
Bag<E> |
build()
Finalizes the creation of the
ImmutableBag. |
public ImmutableBag.Builder<E> add(E... values)
Bag being built.values - the values to add.NullPointerException - if values is null.public ImmutableBag.Builder<E> add(Iterable<? extends E> values)
Iterable
to the Bag being built.values - the values to add.NullPointerException - if values is null.public ImmutableBag.Builder<E> add(Iterator<? extends E> values)
Iterator
to the Bag being built.values - the values to add.NullPointerException - if values is null.Copyright © 2012–2015. All rights reserved.