com.vaadin.flow.data.provider.
Class SortOrderBuilder<T extends SortOrder<V>,V>
- java.lang.Object
-
- com.vaadin.flow.data.provider.SortOrderBuilder<T,V>
-
Type Parameters:
T
- the sort order typeV
- the sorting typeAll Implemented Interfaces:
Direct Known Subclasses:
public abstract class SortOrderBuilder<T extends SortOrder<V>,V> extends Object implements Serializable
Base class for helper classes with fluent API for constructing sort order lists. When the sort order is ready to be passed on, calling
build()
will create the list of sort orders.Since:
1.0
See Also:
-
-
Constructor Summary
Constructors Constructor Description SortOrderBuilder()
-
Method Summary
All Methods Modifier and Type Method Description List<T>
build()
Returns an unmodifiable copy of the list of current sort orders in this sort builder.
protected abstract T
createSortOrder(V by, SortDirection direction)
Creates a sort order object with the given parameters.
SortOrderBuilder<T,V>
thenAsc(V by)
Appends sorting with ascending sort direction.
SortOrderBuilder<T,V>
thenDesc(V by)
Appends sorting with descending sort direction.
-
-
-
Method Detail
-
thenAsc
public SortOrderBuilder<T,V> thenAsc(V by)
Appends sorting with ascending sort direction.
Parameters:
by
- the object to sort byReturns:
this sort builder
-
thenDesc
public SortOrderBuilder<T,V> thenDesc(V by)
Appends sorting with descending sort direction.
Parameters:
by
- the object to sort byReturns:
this sort builder
-
build
public final List<T> build()
Returns an unmodifiable copy of the list of current sort orders in this sort builder.
Returns:
an unmodifiable sort order list
-
createSortOrder
protected abstract T createSortOrder(V by, SortDirection direction)
Creates a sort order object with the given parameters.
Parameters:
by
- the object to sort bydirection
- the sort directionReturns:
the sort order object
-
-