public final class CollectionSupport
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
CollectionSupport()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
addIf(java.util.Collection<? super T> target,
java.util.Collection<T> elements,
com.google.common.base.Predicate<? super T> predicate)
Adds a collection of elements to a collection for each element that meets the requirements of a given predicate.
|
static <T> boolean |
addIf(java.util.Collection<? super T> target,
java.util.Collection<T> elements,
com.google.common.base.Predicate<? super T> predicate,
com.google.common.base.Function<? super T,T> elementPreprocessor)
Adds a collection of elements to a collection for each element that meets the requirements of a given predicate.
|
static <T> boolean |
addIf(java.util.Collection<? super T> target,
T element,
com.google.common.base.Predicate<? super T> predicate)
Adds an element to a collection if it meets the requirements of a given predicate.
|
static <T> boolean |
addIf(java.util.Collection<? super T> target,
T element,
com.google.common.base.Predicate<? super T> predicate,
com.google.common.base.Function<? super T,T> elementPreprocessor)
Adds an element to a collection if it meets the requirements of a given predicate.
|
static <T> boolean |
removeIf(java.util.Collection<T> target,
java.util.Collection<T> elements,
com.google.common.base.Predicate<? super T> predicate)
Removes a collection of elements to a collection for each element that meets the requirements of a given
predicate.
|
static <T> boolean |
removeIf(java.util.Collection<T> target,
java.util.Collection<T> elements,
com.google.common.base.Predicate<? super T> predicate,
com.google.common.base.Function<? super T,T> elementPreprocessor)
Removes a collection of elements to a collection for each element that meets the requirements of a given
predicate.
|
static <T> boolean |
removeIf(java.util.Collection<T> target,
T element,
com.google.common.base.Predicate<? super T> predicate)
Removes an element to a collection if it meets the requirements of a given predicate.
|
static <T> boolean |
removeIf(java.util.Collection<T> target,
T element,
com.google.common.base.Predicate<? super T> predicate,
com.google.common.base.Function<? super T,T> elementPreprocessor)
Removes an element to a collection if it meets the requirements of a given predicate.
|
public static <T> boolean addIf(@Nonnull
java.util.Collection<? super T> target,
@Nullable
T element,
@Nonnull
com.google.common.base.Predicate<? super T> predicate)
T - type of element in the collectiontarget - collection to which elements will be addedelement - element that may be added to the collectionpredicate - predicate the given element must meet in order to be added to the given collectionpublic static <T> boolean addIf(@Nonnull
java.util.Collection<? super T> target,
@Nullable
T element,
@Nonnull
com.google.common.base.Predicate<? super T> predicate,
@Nonnull
com.google.common.base.Function<? super T,T> elementPreprocessor)
T - type of element in the collectiontarget - collection to which elements will be addedelement - element that may be added to the collectionpredicate - predicate the given element must meet in order to be added to the given collectionelementPreprocessor - function applied to element prior to predicate evaluation and being added the
collectionpublic static <T> boolean addIf(@Nonnull
java.util.Collection<? super T> target,
@Nullable
java.util.Collection<T> elements,
@Nonnull
com.google.common.base.Predicate<? super T> predicate)
T - type of element in the collectiontarget - collection to which elements will be addedelements - elements that may be added to the collectionpredicate - predicate the given element must meet in order to be added to the given collectionpublic static <T> boolean addIf(@Nonnull
java.util.Collection<? super T> target,
@Nullable
java.util.Collection<T> elements,
@Nonnull
com.google.common.base.Predicate<? super T> predicate,
@Nonnull
com.google.common.base.Function<? super T,T> elementPreprocessor)
T - type of element in the collectiontarget - collection to which elements will be addedelements - elements that may be added to the collectionpredicate - predicate the given element must meet in order to be added to the given collectionelementPreprocessor - function applied to element prior to predicate evaluation and being added the
collectionpublic static <T> boolean removeIf(@Nonnull
java.util.Collection<T> target,
@Nullable
T element,
@Nonnull
com.google.common.base.Predicate<? super T> predicate)
T - type of element in the collectiontarget - collection to which elements will be removedelement - element that may be removed from the collectionpredicate - predicate the given element must meet in order to be removed from the given collectionpublic static <T> boolean removeIf(@Nonnull
java.util.Collection<T> target,
@Nullable
T element,
@Nonnull
com.google.common.base.Predicate<? super T> predicate,
@Nonnull
com.google.common.base.Function<? super T,T> elementPreprocessor)
T - type of element in the collectiontarget - collection to which elements will be removedelement - element that may be removed from the collectionpredicate - predicate the given element must meet in order to be removed from the given collectionelementPreprocessor - function applied to element prior to predicate evaluation and being removed from the
collectionpublic static <T> boolean removeIf(@Nonnull
java.util.Collection<T> target,
@Nullable
java.util.Collection<T> elements,
@Nonnull
com.google.common.base.Predicate<? super T> predicate)
T - type of element in the collectiontarget - collection to which elements will be removedelements - elements that may be removed from the collectionpredicate - predicate the given element must meet in order to be removed from the given collectionpublic static <T> boolean removeIf(@Nonnull
java.util.Collection<T> target,
@Nullable
java.util.Collection<T> elements,
@Nonnull
com.google.common.base.Predicate<? super T> predicate,
@Nonnull
com.google.common.base.Function<? super T,T> elementPreprocessor)
T - type of element in the collectiontarget - collection to which elements will be removedelements - elements that may be removed from the collectionpredicate - predicate the given element must meet in order to be removed from the given collectionelementPreprocessor - function applied to element prior to predicate evaluation and being removed from the
collection