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

org.butterfaces.model.table.json.Ordering Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
package org.butterfaces.model.table.json;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * DTO and helper class for {@link JsonToModelConverter}.
 */
public class Ordering {
    private final Integer index;
    private final String identifier;

    public Ordering(final String identifier, final int index) {
        this.index = index;
        this.identifier = identifier;
    }

    public Integer getIndex() {
        return index;
    }

    public String getIdentifier() {
        return identifier;
    }

    public static void sort(final List orderings) {
        Collections.sort(orderings, new Comparator() {
            @Override
            public int compare(Ordering o1, Ordering o2) {
                return o1.getIndex().compareTo(o2.getIndex());
            }
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy