Package com.google.common.collect
Class ImmutableCollection.Builder<E>
- java.lang.Object
-
- com.google.common.collect.ImmutableCollection.Builder<E>
-
- Direct Known Subclasses:
ImmutableList.Builder
,ImmutableMultiset.Builder
,ImmutableSet.Builder
- Enclosing class:
- ImmutableCollection<E>
@Deprecated(since="2022-12-01") public abstract static class ImmutableCollection.Builder<E> extends java.lang.Object
Deprecated.The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023Abstract base class for builders ofImmutableCollection
types.- Since:
- 10.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract ImmutableCollection.Builder<E>
add(E element)
Deprecated.Addselement
to theImmutableCollection
being built.ImmutableCollection.Builder<E>
add(E... elements)
Deprecated.Adds each element ofelements
to theImmutableCollection
being built.ImmutableCollection.Builder<E>
addAll(java.lang.Iterable<? extends E> elements)
Deprecated.Adds each element ofelements
to theImmutableCollection
being built.ImmutableCollection.Builder<E>
addAll(java.util.Iterator<? extends E> elements)
Deprecated.Adds each element ofelements
to theImmutableCollection
being built.abstract ImmutableCollection<E>
build()
Deprecated.Returns a newly-createdImmutableCollection
of the appropriate type, containing the elements provided to this builder.
-
-
-
Method Detail
-
add
public abstract ImmutableCollection.Builder<E> add(E element)
Deprecated.Addselement
to theImmutableCollection
being built.Note that each builder class covariantly returns its own type from this method.
- Parameters:
element
- the element to add- Returns:
- this
Builder
instance - Throws:
java.lang.NullPointerException
- ifelement
is null
-
add
public ImmutableCollection.Builder<E> add(E... elements)
Deprecated.Adds each element ofelements
to theImmutableCollection
being built.Note that each builder class overrides this method in order to covariantly return its own type.
- Parameters:
elements
- the elements to add- Returns:
- this
Builder
instance - Throws:
java.lang.NullPointerException
- ifelements
is null or contains a null element
-
addAll
public ImmutableCollection.Builder<E> addAll(java.lang.Iterable<? extends E> elements)
Deprecated.Adds each element ofelements
to theImmutableCollection
being built.Note that each builder class overrides this method in order to covariantly return its own type.
- Parameters:
elements
- the elements to add- Returns:
- this
Builder
instance - Throws:
java.lang.NullPointerException
- ifelements
is null or contains a null element
-
addAll
public ImmutableCollection.Builder<E> addAll(java.util.Iterator<? extends E> elements)
Deprecated.Adds each element ofelements
to theImmutableCollection
being built.Note that each builder class overrides this method in order to covariantly return its own type.
- Parameters:
elements
- the elements to add- Returns:
- this
Builder
instance - Throws:
java.lang.NullPointerException
- ifelements
is null or contains a null element
-
build
public abstract ImmutableCollection<E> build()
Deprecated.Returns a newly-createdImmutableCollection
of the appropriate type, containing the elements provided to this builder.Note that each builder class covariantly returns the appropriate type of
ImmutableCollection
from this method.
-
-