package com.tzld.piaoquan.ad.engine.commons.score;

import com.google.gson.Gson;
import com.typesafe.config.Config;

import java.util.Set;


public class ScorerConfigInfo {

    private String configName;
    private Integer scorerPriority;
    private Boolean disableSwitch;
    private String scorerName;
    private Set<String> enableQueues;
    private String modelPath;
    private Config paramConfig; // param config

    public ScorerConfigInfo(String configName,
                            String scorerName,
                            Integer scorerPriority,
                            Boolean disableSwitch,
                            Set<String> enableQueues,
                            String modelPath,
                            Config paramConfig) {

        this.configName = configName;
        this.scorerName = scorerName;
        this.scorerPriority = scorerPriority;
        this.disableSwitch = disableSwitch;
        this.enableQueues = enableQueues;
        this.modelPath = modelPath;
        this.paramConfig = paramConfig;
    }

    public Config getParamConfig() {
        return paramConfig;
    }

    public Set<String> getEnableQueues() {
        return enableQueues;
    }

    public void setEnableQueues(Set<String> enableQueues) {
        this.enableQueues = enableQueues;
    }

    public Integer getScorerPriority() {
        return scorerPriority;
    }

    public String getScorerName() {
        return scorerName;
    }

    public String getConfigName() {
        return configName;
    }

    public boolean isQueueEnable(String queueName) {
        return this.enableQueues == null ||
                this.enableQueues.isEmpty() ||
                this.enableQueues.contains(queueName);
    }

    public String getModelPath() {
        return modelPath;
    }

    public Boolean getDisableSwitch() {
        return disableSwitch;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }
}
