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