geoportal-data-entry-app/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/SearchingFilter.java

147 lines
2.7 KiB
Java

package org.gcube.portlets.user.geoportaldataentry.shared;
import java.io.Serializable;
import java.util.Map;
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_FIELD;
/**
* The Class SearchingFilter.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 30, 2021
*/
public class SearchingFilter implements Serializable {
/**
* The Enum ORDER.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 30, 2021
*/
public static enum ORDER {
ASC("ASCENDING"), DESC("DESCENDING");
String label;
/**
* Instantiates a new order.
*
* @param label the label
*/
ORDER(String label) {
this.label = label;
}
/**
* Gets the label.
*
* @return the label
*/
public String getLabel() {
return label;
}
}
/**
*
*/
private static final long serialVersionUID = -4004094263090373626L;
private RECORD_FIELD orderByField;
private ORDER order;
private Map<String, Object> searchInto;
/**
* Instantiates a new sort filter.
*/
public SearchingFilter() {
}
/**
* Instantiates a new sort filter.
*
* @param orderByField the order by field
* @param order the order
*/
public SearchingFilter(RECORD_FIELD orderByField, ORDER order) {
this.orderByField = orderByField;
this.order = order;
}
/**
* Instantiates a new sort filter.
*
* @param orderByField the order by field
* @param order the order
*/
public SearchingFilter(RECORD_FIELD orderByField, ORDER order, Map<String, Object> searchInto) {
this.orderByField = orderByField;
this.order = order;
this.searchInto = searchInto;
}
public void setSearchInto(Map<String, Object> searchInto) {
this.searchInto = searchInto;
}
/**
* 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;
}
public Map<String, Object> getSearchInto() {
return searchInto;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("SearchingFilter [orderByField=");
builder.append(orderByField);
builder.append(", order=");
builder.append(order);
builder.append(", searchInto=");
builder.append(searchInto);
builder.append("]");
return builder.toString();
}
}