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

cn.org.atool.fluent.mybatis.ifs.InIfs Maven / Gradle / Ivy

There is a newer version: 1.9.9
Show newest version
package cn.org.atool.fluent.mybatis.ifs;

import java.util.Collection;
import java.util.function.Predicate;

/**
 * 对 IN collection进行条件选择
 *
 * @author wudarui
 */
@SuppressWarnings("all")
public class InIfs extends Ifs {
    public InIfs when(Predicate predicate, T... values) {
        this.predicates.add(new IfsPredicate(predicate, values));
        return this;
    }

    public InIfs other(T... values) {
        this.predicates.add(new IfsPredicate(v -> true, values));
        return this;
    }

    @Override
    public InIfs when(Predicate predicate, Collection value) {
        this.predicates.add(new IfsPredicate(predicate, value == null ? null : value.toArray()));
        return this;
    }

    @Override
    public InIfs other(Collection value) {
        return this.when(v -> true, value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy