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, @Nullable Long version, @Nullable String name, @Nullable 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;
    }

    @Nullable
    public Long getVersion() {
        return version;
    }

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

    public @Nullable String getName() {
        return name;
    }

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

    public @Nullable String getValue() {
        return value;
    }

    public void setValue(@Nullable 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 + '\'' +
            '}';
    }
}
