
mboog.support.example.Criterion Maven / Gradle / Ivy
package mboog.support.example;
import java.io.Serializable;
import java.util.List;
/**
* @author LiYi
*/
public class Criterion implements Serializable {
private static final long serialVersionUID = 1L;
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
protected String prefix;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
public String getPrefix() {
return prefix;
}
public Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
public Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
public Criterion(String condition, Object value) {
this(condition, value, null);
}
public Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
public Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
protected Criterion prefix(String prefix) {
this.prefix = prefix;
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy