org.xbib.cql.model.Facet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cql Show documentation
Show all versions of cql Show documentation
Contextual Query Language compiler for Java
package org.xbib.cql.model;
import org.xbib.cql.QueryFacet;
/**
* Facet.
*
* @param parameter type
*/
public final class Facet implements QueryFacet, Comparable> {
private int size;
private String filterName;
private String name;
private V value;
public Facet(String name) {
this.name = name;
}
public Facet(String name, String filterName, int size) {
this.name = name;
this.filterName = filterName;
this.size = size;
}
@Override
public void setName(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
@Override
public void setValue(V value) {
this.value = value;
}
@Override
public V getValue() {
return value;
}
@Override
public int getSize() {
return size;
}
@Override
public String getFilterName() {
return filterName;
}
public String toCQL() {
return CQLQueryModel.FACET_INDEX_NAME + "." + name + " = " + value;
}
@Override
public int compareTo(Facet o) {
return name.compareTo((o).getName());
}
@Override
public String toString() {
return toCQL();
}
}