com.vaadin.data.provider.GridSortOrderBuilder Maven / Gradle / Ivy
/*
* Copyright (C) 2000-2024 Vaadin Ltd
*
* This program is available under Vaadin Commercial License and Service Terms.
*
* See for the full
* license.
*/
package com.vaadin.data.provider;
import com.vaadin.shared.data.sort.SortDirection;
import com.vaadin.ui.Grid.Column;
/**
* Helper classes with fluent API for constructing {@link GridSortOrder} lists.
* When the sort order is ready to be passed on, calling {@link #build()} will
* create the list of sort orders.
*
* @see GridSortOrder
* @see #thenAsc(Column)
* @see #thenDesc(Column)
* @see #build()
*
* @param
* the type of the grid
* @since 8.0
*/
public class GridSortOrderBuilder
extends SortOrderBuilder, Column> {
@Override
public GridSortOrderBuilder thenAsc(Column by) {
return (GridSortOrderBuilder) super.thenAsc(by);
}
@Override
public GridSortOrderBuilder thenDesc(Column by) {
return (GridSortOrderBuilder) super.thenDesc(by);
}
@Override
protected GridSortOrder createSortOrder(Column by,
SortDirection direction) {
return new GridSortOrder<>(by, direction);
}
}