public class BuilderSupport extends Object
Modifier and Type | Field and Description |
---|---|
protected static Predicate<String> |
NOT_BLANK |
Constructor and Description |
---|
BuilderSupport() |
Modifier and Type | Method and Description |
---|---|
protected static <T> void |
addIf(Predicate<? super T> predicate,
Collection<T> collection,
Iterable<? extends T> values) |
protected static <T> boolean |
addIf(Predicate<? super T> predicate,
Collection<T> collection,
T value) |
protected static <T> void |
addIf(Predicate<? super T> predicate,
Collection<T> collection,
T value,
T... values) |
protected static <T> void |
addIf(Predicate<? super T> predicate,
com.google.common.collect.ImmutableCollection.Builder<T> builder,
Iterable<? extends T> values) |
protected static <T> boolean |
addIf(Predicate<? super T> predicate,
com.google.common.collect.ImmutableCollection.Builder<T> builder,
T value) |
protected static <T> void |
addIf(Predicate<? super T> predicate,
com.google.common.collect.ImmutableCollection.Builder<T> builder,
T value,
T... values) |
protected static String |
checkNotBlank(String value,
String name) |
protected static String |
requireNonBlank(String value,
String name) |
protected static <T> boolean addIf(@Nonnull Predicate<? super T> predicate, @Nonnull Collection<T> collection, @Nullable T value)
protected static <T> boolean addIf(@Nonnull Predicate<? super T> predicate, @Nonnull com.google.common.collect.ImmutableCollection.Builder<T> builder, @Nullable T value)
@SafeVarargs protected static <T> void addIf(@Nonnull Predicate<? super T> predicate, @Nonnull Collection<T> collection, @Nullable T value, @Nullable T... values)
T
- type for the builderpredicate
- verifies elements prior to adding them to the collectioncollection
- the collection to which elements accepted by the predicate should be addedvalue
- the first element to addvalues
- a varargs array containing 0 or more elements to add after the first@SafeVarargs protected static <T> void addIf(@Nonnull Predicate<? super T> predicate, @Nonnull com.google.common.collect.ImmutableCollection.Builder<T> builder, @Nullable T value, @Nullable T... values)
protected static <T> void addIf(@Nonnull Predicate<? super T> predicate, @Nonnull Collection<T> collection, @Nullable Iterable<? extends T> values)
protected static <T> void addIf(@Nonnull Predicate<? super T> predicate, @Nonnull com.google.common.collect.ImmutableCollection.Builder<T> builder, @Nullable Iterable<? extends T> values)
@Nonnull protected static String checkNotBlank(@Nullable String value, @Nullable String name)
@Nonnull protected static String requireNonBlank(@Nullable String value, @Nullable String name)
value
- the value to ensure is not null
or blank.name
- a name for the value, used in exception messagesvalue
, if it is not null
or blankIllegalArgumentException
- if the provided value
is blankNullPointerException
- if the provided value
is null
Copyright © 2020 Atlassian. All rights reserved.