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

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

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

import lombok.AccessLevel;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;

/**
 * 分支设置
 *
 * @param 
 * @author wudarui
 */
@Getter
public class Ifs {
    /**
     * 选择分支
     */
    @Getter(AccessLevel.NONE)
    public final List predicates = new ArrayList<>();

    public Ifs() {
    }

    public Ifs when(Predicate predicate, T value) {
        this.predicates.add(new IfsPredicate(predicate, value));
        return this;
    }

    public Ifs other(T value) {
        return this.when(v -> true, value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy