com.vaadin.data.provider.GridSortOrder 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;
/**
* Sorting information for {@link com.vaadin.ui.Grid Grid}.
*
* @param
* the grid type
* @since 8.0
*/
public class GridSortOrder extends SortOrder> {
/**
* Construct sorting information for usage in a {@link com.vaadin.ui.Grid
* Grid}.
*
* @param column
* the column to be sorted
* @param direction
* sorting direction
*/
public GridSortOrder(Column column, SortDirection direction) {
super(column, direction);
}
/**
* Gets the column this sorting information is attached to.
*
* @return the column being sorted
*/
@Override
public Column getSorted() {
return super.getSorted();
}
/**
* Creates a new grid sort builder with given sorting using ascending sort
* direction.
*
* @param by
* the column to sort by
* @param
* the grid type
*
* @return the grid sort builder
*/
public static GridSortOrderBuilder asc(Column by) {
return new GridSortOrderBuilder().thenAsc(by);
}
/**
* Creates a new grid sort builder with given sorting using descending sort
* direction.
*
* @param by
* the column to sort by
* @param
* the grid type
*
* @return the grid sort builder
*/
public static GridSortOrderBuilder desc(Column by) {
return new GridSortOrderBuilder().thenDesc(by);
}
}