All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.data.provider.SortOrder Maven / Gradle / Ivy

There is a newer version: 8.27.1
Show newest version
/*
 * Copyright (C) 2000-2023 Vaadin Ltd
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See  for the full
 * license.
 */
package com.vaadin.data.provider;

import java.io.Serializable;

import com.vaadin.shared.data.sort.SortDirection;

/**
 * Sorting information for one field.
 *
 * @param 
 *            the type of the sorting information, usually a String (field id)
 *            or a {@link java.util.Comparator}.
 * @since 8.0
 */
public class SortOrder implements Serializable {

    private final T sorted;
    private final SortDirection direction;

    /**
     * Constructs a field sorting information.
     *
     * @param sorted
     *            sorting information, usually field id or
     *            {@link java.util.Comparator}
     * @param direction
     *            sorting direction
     */
    public SortOrder(T sorted, SortDirection direction) {
        this.sorted = sorted;
        this.direction = direction;
    }

    /**
     * Sorting information.
     *
     * @return sorting entity, usually field id or {@link java.util.Comparator}
     */
    public T getSorted() {
        return sorted;
    }

    /**
     * Sorting direction.
     *
     * @return sorting direction
     */
    public SortDirection getDirection() {
        return direction;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy