com.magic.db.conversion.ConditionBuilder Maven / Gradle / Ivy
package com.magic.db.conversion;
import com.magic.db.model.Condition;
import java.util.ArrayList;
import java.util.List;
/**
* 条件构造器
*/
public class ConditionBuilder {
/**
* 条件集合
*/
private List conditionList;
/**
* 创建一个条件构造器对象
* @return
*/
public static ConditionBuilder createCondition(){
ConditionBuilder conditionBuilder = new ConditionBuilder();
conditionBuilder.conditionList = new ArrayList<>();
return conditionBuilder;
}
/**
* 添加一个条件
* @param key
* @param val
* @return
*/
public ConditionBuilder add(String key, Object... val){
conditionList.add(Condition.get(key, val));
return this;
}
/**
* 获取条件集合
* @return
*/
public List build(){
return conditionList;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy