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

com.feingto.cloud.dto.monitor.RuleGroup Maven / Gradle / Ivy

There is a newer version: 2.3.5.RELEASE
Show newest version
package com.feingto.cloud.dto.monitor;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 规则组
 *
 * @author longfei
 */
@Data
@Accessors(chain = true)
public class RuleGroup implements Serializable {
    private static final long serialVersionUID = -570028056922107807L;

    private List rules = new ArrayList<>();

    /**
     * 操作符
     */
    private UnionOperator op;

    /**
     * 备注
     */
    private String remark;

    /**
     * 操作符(AND 或者 OR)
     */
    public enum UnionOperator {
        AND, OR;

        @JsonValue
        public String getName() {
            return name();
        }

        @JsonCreator
        public static UnionOperator setName(String op) {
            for (UnionOperator item : values()) {
                if (item.name().equalsIgnoreCase(op)) {
                    return item;
                }
            }
            return null;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy