Package io.vertigo.core.util
Class ListBuilder<X>
- java.lang.Object
-
- io.vertigo.core.util.ListBuilder<X>
-
-
Constructor Summary
Constructors Constructor Description ListBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListBuilder<X>add(X value)Adds a value in the list.ListBuilder<X>addAll(Collection<? extends X> values)Adds a collection of values in the list.List<X>build()ListBuilder<X>sort(Comparator<? super X> comparator)Sorts the list with the provided comparator.ListBuilder<X>unmodifiable()Makes this list as unmodifiable.
-
-
-
Method Detail
-
add
public ListBuilder<X> add(X value)
Adds a value in the list. The value CAN NOT be null.- Parameters:
value- Value not null- Returns:
- this builder
-
addAll
public ListBuilder<X> addAll(Collection<? extends X> values)
Adds a collection of values in the list. These values CAN NOT be null.- Parameters:
values- Values not null- Returns:
- this builder
-
unmodifiable
public ListBuilder<X> unmodifiable()
Makes this list as unmodifiable.- Returns:
- this builder
-
sort
public ListBuilder<X> sort(Comparator<? super X> comparator)
Sorts the list with the provided comparator.- Parameters:
comparator- the comparator to use- Returns:
- this builder
-
-