package ru.nbch.indicsearchservice.model;

import jakarta.annotation.Nullable;
import java.util.Objects;

public class Settings {
    private Long id;

    @Nullable
    private Long version;
    @Nullable
    private String name;
    @Nullable
    private String value;

    public Settings() {
    }

    public Settings(Long id, Long version, String name, String value) {
        this.id = id;
        this.version = version;
        this.name = name;
        this.value = value;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        Settings settings = (Settings) o;
        return Objects.equals(id, settings.id);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "Settings{" +
            "id=" + id +
            ", version=" + version +
            ", name='" + name + '\'' +
            ", value='" + value + '\'' +
            '}';
    }
}
