com.github.chengyuxing.sql.dsl.clause.condition.Condition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rabbit-sql Show documentation
Show all versions of rabbit-sql Show documentation
Light wrapper of JDBC, support ddl, dml, query, plsql/procedure/function, transaction and manage sql
file.
package com.github.chengyuxing.sql.dsl.clause.condition;
import com.github.chengyuxing.sql.dsl.types.Operator;
public class Condition implements Criteria {
protected final String column;
protected final Operator operator;
protected final T value;
protected final String valueKey;
public Condition(String column, Operator operator, T value) {
this.column = column;
this.operator = operator;
this.value = value;
this.valueKey = column;
}
public Condition(String column, Operator operator, T value, String valueKey) {
this.column = column;
this.operator = operator;
this.value = value;
this.valueKey = valueKey;
}
public String getColumn() {
return column;
}
public Operator getOperator() {
return operator;
}
public Object getValue() {
return value;
}
public String getKey(int index) {
return valueKey + "__" + index;
}
@Override
public String toString() {
return "Condition{" +
"column='" + column + '\'' +
", operator=" + operator +
", value=" + value +
'}';
}
}