package cn.axzo.msg.center.service.domain;

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * @author yanglin
 */
@Setter
@Getter
public class GroupConfig {

    /**
     * key/value的配置
     */
    private List<KVConfig> keyValues;

    /**
     * 详情的配置
     */
    private DetailConfig detail;

    public void removeEmptyValues() {
        if (keyValues == null) return;
        keyValues.removeIf(kv -> {
            String value = kv.getValue();
            return StringUtils.isBlank(value) || "null".equalsIgnoreCase(value);
        });
    }

}