Package google.registry.util
Class NullIgnoringCollectionBuilder<E,B extends com.google.common.collect.ImmutableCollection.Builder<E>>
java.lang.Object
google.registry.util.NullIgnoringCollectionBuilder<E,B>
public class NullIgnoringCollectionBuilder<E,B extends com.google.common.collect.ImmutableCollection.Builder<E>>
extends Object
Collection builder that simply ignores requests to add null elements.
Useful because we do this in a number of cases.
-
Method Summary
Modifier and TypeMethodDescriptionIf 'elem' is not null, add it to the builder.static <E2,
B2 extends com.google.common.collect.ImmutableCollection.Builder<E2>>
NullIgnoringCollectionBuilder<E2, B2> create
(B2 builder) Returns the underlying builder.
-
Method Details
-
create
public static <E2,B2 extends com.google.common.collect.ImmutableCollection.Builder<E2>> NullIgnoringCollectionBuilder<E2,B2> create(B2 builder) -
add
If 'elem' is not null, add it to the builder. -
getBuilder
Returns the underlying builder.
-