E - The element type.C - The final type of the target instance, at least Collection.S - The final type of the Setup implementation.@FunctionalInterface public static interface Collecting.Setup<E,C extends Collection<E>,S extends Collecting.Setup<E,C,S>> extends Setup<C,S>
Collection.| Modifier and Type | Method and Description |
|---|---|
default S |
add(E element)
Adds an element to the instance to be set up.
|
default S |
add(E element0,
E element1,
E... more)
Adds two or more elements to the instance to be set up.
|
default S |
addAll(Collection<? extends E> elements)
Adds multiple elements to the instance to be set up.
|
default S |
addAll(E[] elements)
Adds multiple elements to the instance to be set up.
|
default S |
addAll(Iterable<? extends E> elements)
Adds multiple elements to the instance to be set up.
|
default S |
addAll(Iterator<? extends E> elements)
Adds multiple elements to the instance to be set up.
|
default S |
addAll(Stream<? extends E> elements)
Adds multiple elements to the instance to be set up.
|
default S |
clear()
Removes all elements from the instance to be set up.
|
default S |
remove(Object element)
Removes an element from the instance to be set up.
|
default S |
remove(Object element0,
Object element1,
Object... more)
Removes two or more elements from the instance to be set up.
|
default S |
removeAll(Collection<?> elements)
Removes multiple elements from the instance to be set up.
|
default S |
removeAll(Iterable<?> elements)
Removes multiple elements from the instance to be set up.
|
default S |
removeAll(Iterator<?> elements)
Removes multiple elements from the instance to be set up.
|
default S |
removeAll(Object[] elements)
Removes multiple elements from the instance to be set up.
|
default S |
removeAll(Stream<?> elements)
Removes multiple elements from the instance to be set up.
|
default S |
removeIf(Predicate<? super E> filter)
Removes multiple elements from the instance to be set up.
|
default S |
retainAll(Collection<?> elements)
Retains multiple elements by removing all others from the instance to be set up.
|
default S |
retainAll(Iterable<?> elements)
Retains multiple elements by removing all others from the instance to be set up.
|
default S |
retainAll(Iterator<?> elements)
Retains multiple elements by removing all others from the instance to be set up.
|
default S |
retainAll(Object[] elements)
Retains multiple elements by removing all others from the instance to be set up.
|
default S |
retainAll(Stream<?> elements)
Retains multiple elements by removing all others from the instance to be set up.
|
default S add(E element)
UnsupportedOperationException - if Collection.add(Object) is not supported by the instance
to be set up.NullPointerException - if the specified element is null and the instance
to be set up does not permit null elements.ClassCastException - if the class of the specified element prevents it from being
added to the instance to be set up
(may occur only if used raw or forced in a mismatched class context).IllegalArgumentException - if some property of the element prevents it from being added
to the instance to be set up.IllegalStateException - if the element cannot be added at this time due to
insertion restrictions on the instance to be set up (if any).Collection.add(Object),
Collecting.add(Collection, Object)default S add(E element0, E element1, E... more)
If the array of more elements is null it will be treated as an empty array.
UnsupportedOperationException - if Collection.add(Object) is not supported by the instance
to be set up.NullPointerException - if any of the specified elements is null and the
instance to be set up does not permit null elements.ClassCastException - if the class of any specified elements
prevents them from being added to the instance to be set up
(may occur only if used raw or forced in a mismatched class context).IllegalArgumentException - if some property of any elements prevents
them from being added to the instance to be set up.IllegalStateException - if any of the elements cannot be added at this time
due to insertion restrictions of the instance to be set up (if any).add(Object),
Collecting.add(Collection, Object, Object, Object[])default S addAll(Collection<? extends E> elements)
If the Collection of elements is null it will be treated as an empty
Collection.
UnsupportedOperationException - if Collection.addAll(Collection) is not supported by the
instance to be set up.NullPointerException - if any of the specified elements is null and the
instance to be set up does not permit null elements.ClassCastException - if the class of any specified elements
prevents them from being added to the instance to be set up
(may occur only if used raw or forced in a mismatched class context).IllegalArgumentException - if some property of any elements prevents
them from being added to the instance to be set up.IllegalStateException - if any of the elements cannot be added at this time
due to insertion restrictions of the instance to be set up (if any).Collection.addAll(Collection),
Collecting.addAll(Collection, Collection),
addAll(Stream),
addAll(Iterable),
addAll(Iterator),
addAll(Object[])default S addAll(Stream<? extends E> elements)
If the Stream of elements is null it will be treated as an empty Stream.
UnsupportedOperationException - if Collection.add(Object) is not supported by the
instance to be set up.NullPointerException - if any of the specified elements is null and the
instance to be set up does not permit null elements.ClassCastException - if the class of any specified elements
prevents them from being added to the instance to be set up
(may occur only if used raw or forced in a mismatched class context).IllegalArgumentException - if some property of any elements prevents
them from being added to the instance to be set up.IllegalStateException - if any of the elements cannot be added at this time
due to insertion restrictions of the instance to be set up (if any).Collecting.addAll(Collection, Stream),
addAll(Collection),
addAll(Iterable),
addAll(Iterator),
addAll(Object[])default S addAll(Iterable<? extends E> elements)
Treats a null-argument just like an empty Iterable.
UnsupportedOperationException - if Collection.add(Object) or
if Collection.addAll(Collection) is not supported by the
instance to be set up.NullPointerException - if any of the specified elements is null and the
instance to be set up does not permit null elements.ClassCastException - if the class of any specified elements
prevents them from being added to the instance to be set up
(may occur only if used raw or forced in a mismatched class context).IllegalArgumentException - if some property of any elements prevents
them from being added to the instance to be set up.IllegalStateException - if any of the elements cannot be added at this time
due to insertion restrictions of the instance to be set up (if any).Collecting.addAll(Collection, Iterable),
addAll(Collection),
addAll(Stream),
addAll(Iterator),
addAll(Object[])default S addAll(Iterator<? extends E> elements)
Treats a null-argument just like an empty Iterator.
UnsupportedOperationException - if Collection.add(Object) or
if Collection.addAll(Collection) is not supported by the
instance to be set up.NullPointerException - if any of the specified elements is null and the
instance to be set up does not permit null elements.ClassCastException - if the class of any specified elements
prevents them from being added to the instance to be set up
(may occur only if used raw or forced in a mismatched class context).IllegalArgumentException - if some property of any elements prevents
them from being added to the instance to be set up.IllegalStateException - if any of the elements cannot be added at this time
due to insertion restrictions of the instance to be set up (if any).Collecting.addAll(Collection, Iterable),
addAll(Collection),
addAll(Stream),
addAll(Iterable),
addAll(Object[])default S addAll(E[] elements)
Treats a null-argument just like an empty array.
UnsupportedOperationException - if Collection.add(Object) or
if Collection.addAll(Collection) is not supported by the
instance to be set up.NullPointerException - if any of the specified elements is null and the
instance to be set up does not permit null elements.ClassCastException - if the class of any specified elements
prevents them from being added to the instance to be set up
(may occur only if used raw or forced in a mismatched class context).IllegalArgumentException - if some property of any elements prevents
them from being added to the instance to be set up.IllegalStateException - if any of the elements cannot be added at this time
due to insertion restrictions of the instance to be set up (if any).Collecting.addAll(Collection, Iterable),
addAll(Collection),
addAll(Stream),
addAll(Iterable),
addAll(Iterator)default S remove(Object element)
If the instance to be set up contains the element several times, each occurrence will be removed!
Avoids an unnecessary ClassCastException or NullPointerException which might be caused by
Collection.remove(Object) or Collection.removeAll(Collection) when the instance to be set up
does not support the requested element.
UnsupportedOperationException - if Collection.remove(Object) or
if Collection.removeAll(Collection) is not supported by the
instance to be set up.Collection.remove(Object),
Collecting.remove(Collection, Object)default S remove(Object element0, Object element1, Object... more)
If the instance to be set up contains an element several times, each occurrence will be removed!
UnsupportedOperationException - if Collection.remove(Object) or
if Collection.removeAll(Collection) is not supported by the
instance to be set up.remove(Object),
Collecting.remove(Collection, Object, Object, Object[])default S removeAll(Collection<?> elements)
If the instance to be set up contains an element several times, each occurrence will be removed!
Treats a null-argument just like an empty Collection.
Avoids an unnecessary ClassCastException or NullPointerException which might be caused by
Collection.remove(Object) or Collection.removeAll(Collection) when the instance to be set up
does not support the requested elements.
UnsupportedOperationException - if Collection.remove(Object) or
if Collection.removeAll(Collection) is not supported by the
instance to be set up.Collection.removeAll(Collection),
Collecting.removeAll(Collection, Collection),
removeAll(Stream),
removeAll(Iterable),
removeAll(Iterator),
removeAll(Object[])default S removeAll(Stream<?> elements)
If the instance to be set up contains an element several times, each occurrence will be removed!
Treats a null-argument just like an empty Stream.
UnsupportedOperationException - if Collection.remove(Object) or
if Collection.removeAll(Collection) is not supported by the
instance to be set up.Collecting.removeAll(Collection, Stream),
removeAll(Collection),
removeAll(Iterable),
removeAll(Iterator),
removeAll(Object[])default S removeAll(Iterable<?> elements)
If the instance to be set up contains an element several times, each occurrence will be removed!
Treats a null-argument just like an empty Iterable.
UnsupportedOperationException - if Collection.remove(Object) or
if Collection.removeAll(Collection) is not supported by the
instance to be set up.Collecting.removeAll(Collection, Iterable),
removeAll(Collection),
removeAll(Stream),
removeAll(Iterator),
removeAll(Object[])default S removeAll(Iterator<?> elements)
If the instance to be set up contains an element several times, each occurrence will be removed!
Treats a null-argument just like an empty Iterator.
UnsupportedOperationException - if Collection.remove(Object) or
if Collection.removeAll(Collection) is not supported by the
instance to be set up.Collecting.removeAll(Collection, Iterable),
removeAll(Collection),
removeAll(Stream),
removeAll(Iterable),
removeAll(Object[])default S removeAll(Object[] elements)
If the instance to be set up contains an element several times, each occurrence will be removed!
Treats a null-argument just like an empty array.
UnsupportedOperationException - if Collection.remove(Object) or
if Collection.removeAll(Collection) is not supported by the
instance to be set up.Collecting.removeAll(Collection, Object[]),
removeAll(Collection),
removeAll(Stream),
removeAll(Iterable),
removeAll(Iterator)default S removeIf(Predicate<? super E> filter)
UnsupportedOperationException - if Collection.removeIf(Predicate) is not supported by the
instance to be set up.NullPointerException - if the filter is null.Collection.removeIf(Predicate),
Collecting.removeIf(Collection, Predicate)default S retainAll(Collection<?> elements)
Treats a null-argument just like an empty Collection.
Avoids an unnecessary ClassCastException or NullPointerException which might be caused by
Collection.retainAll(Collection) when the instance to be set up does not support the requested
elements.
UnsupportedOperationException - if Collection.retainAll(Collection) is not supported by the
instance to be set up.Collection.retainAll(Collection),
Collecting.retainAll(Collection, Collection),
retainAll(Stream),
retainAll(Iterable),
retainAll(Iterator),
retainAll(Object[])default S retainAll(Stream<?> elements)
Treats a null-argument just like an empty Stream.
UnsupportedOperationException - if Collection.retainAll(Collection) is not supported by the
instance to be set up.Collecting.retainAll(Collection, Stream),
retainAll(Collection),
retainAll(Iterable),
retainAll(Iterator),
retainAll(Object[])default S retainAll(Iterable<?> elements)
Treats a null-argument just like an empty Iterable.
UnsupportedOperationException - if Collection.retainAll(Collection) is not supported by the
instance to be set up.Collecting.retainAll(Collection, Iterable),
retainAll(Collection),
retainAll(Stream),
retainAll(Iterator),
retainAll(Object[])default S retainAll(Iterator<?> elements)
Treats a null-argument just like an empty Iterator.
UnsupportedOperationException - if Collection.retainAll(Collection) is not supported by the
instance to be set up.Collecting.retainAll(Collection, Iterable),
retainAll(Collection),
retainAll(Stream),
retainAll(Iterable),
retainAll(Object[])default S retainAll(Object[] elements)
Treats a null-argument just like an empty array.
UnsupportedOperationException - if Collection.retainAll(Collection) is not supported by the
instance to be set up.Collecting.retainAll(Collection, Object[]),
retainAll(Collection),
retainAll(Stream),
retainAll(Iterable),
retainAll(Iterator)default S clear()
UnsupportedOperationException - if Collection.clear() is not supported by the instance to be
set up.Collection.clear(),
Collecting.clear(Collection)Copyright © 2023 Andreas Kluge-Kaindl, Bremen (de). All rights reserved.