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

org.jetlinks.rule.engine.api.model.Condition Maven / Gradle / Ivy

There is a newer version: 1.2.2
Show newest version
package org.jetlinks.rule.engine.api.model;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Map;
import java.util.Optional;

/**
 * 规则条件
 *
 * @author zhouhao
 * @since 1.0.0
 */
@Getter
@Setter
public class Condition implements Serializable {

    private static final long serialVersionUID = -6849794470754667710L;

    private String type;

    private Map configuration;

    @SuppressWarnings("all")
    public  Optional getConfig(String key) {
        return Optional
                .ofNullable(configuration)
                .map(cfg -> (T) cfg.get(key));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy