package com.inspect.ivs.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.Objects;

@Setter
@Getter
@Configuration
@ConfigurationProperties(
        prefix = "zlmedia"
)
public class ZlMediaConfig {
    private boolean enable;
    private String url;
    private String secret;
    private String webrtcPrefix;

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        ZlMediaConfig that = (ZlMediaConfig) object;
        return enable == that.enable && Objects.equals(url, that.url) && Objects.equals(secret, that.secret) && Objects.equals(webrtcPrefix, that.webrtcPrefix);
    }

    @Override
    public int hashCode() {
        return Objects.hash(enable, url, secret, webrtcPrefix);
    }

    @Override
    public String toString() {
        return "ZlMediaConfig{" +
                "enable=" + enable +
                ", url='" + url + '\'' +
                ", secret='" + secret + '\'' +
                ", webrtcPrefix='" + webrtcPrefix + '\'' +
                '}';
    }
}
