All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.magic.db.conversion.ConditionBuilder Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
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