package cd.casic.plugin;

import lombok.Data;

import java.util.Objects;

@Data
public class PluginConfigWrapper {

    /**
     *  插件中的配置文件名称
     */
    private final String fileName;

    /**
     * 配置文件实现类的Class定义
     */
    private final Class<?> configClass;



    public PluginConfigWrapper(String fileName, Class<?> configClass) {
        this.fileName = fileName;
        this.configClass = configClass;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o){
            return true;
        }
        if (!(o instanceof PluginConfigWrapper)){
            return false;
        }
        PluginConfigWrapper that = (PluginConfigWrapper) o;
        return getFileName().equals(that.getFileName()) &&
                getConfigClass().equals(that.getConfigClass());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getFileName(), getConfigClass());
    }
}
