package org.gcube.portlets.user.geoportaldataentry.shared; import java.io.Serializable; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_FIELD; /** * The Class SortFilter. * * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * * Aug 6, 2021 */ public class SortFilter implements Serializable { /** * The Enum ORDER. * * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * * Aug 6, 2021 */ public static enum ORDER { ASC("ASCENDING"), DESC("DESCENDING"); String label; ORDER(String label) { this.label = label; } public String getLabel() { return label; } } /** * */ private static final long serialVersionUID = -4004094263090373626L; private RECORD_FIELD orderByField; private ORDER order; /** * Instantiates a new sort filter. */ public SortFilter() { } /** * Instantiates a new sort filter. * * @param orderByField the order by field * @param order the order */ public SortFilter(RECORD_FIELD orderByField, ORDER order) { this.orderByField = orderByField; this.order = order; } /** * Gets the order by field. * * @return the order by field */ public RECORD_FIELD getOrderByField() { return orderByField; } /** * Gets the order. * * @return the order */ public ORDER getOrder() { return order; } /** * Sets the order by field. * * @param orderByField the new order by field */ public void setOrderByField(RECORD_FIELD orderByField) { this.orderByField = orderByField; } /** * Sets the order. * * @param order the new order */ public void setOrder(ORDER order) { this.order = order; } /** * To string. * * @return the string */ @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("SortFilter [orderByField="); builder.append(orderByField); builder.append(", order="); builder.append(order); builder.append("]"); return builder.toString(); } }