package org.texttechnologylab.project.gruppe_05_1.domain.nlp;

import java.util.Objects;
import java.util.StringJoiner;

public class AudioToken {

    private int begin;
    private int end;
    private double timeStart;
    private double timeEnd;
    private String value;

    public AudioToken() {
    }

    public AudioToken(int begin, int end, double timeStart, double timeEnd, String value) {
        this.begin = begin;
        this.end = end;
        this.timeStart = timeStart;
        this.timeEnd = timeEnd;
        this.value = value;
    }

    public int getBegin() {
        return begin;
    }

    public void setBegin(int begin) {
        this.begin = begin;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }

    public double getTimeStart() {
        return timeStart;
    }

    public void setTimeStart(double timeStart) {
        this.timeStart = timeStart;
    }

    public double getTimeEnd() {
        return timeEnd;
    }

    public void setTimeEnd(double timeEnd) {
        this.timeEnd = timeEnd;
    }

    public String getValue() {
        return value;
    }

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

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof AudioToken that)) return false;
        return begin == that.begin && end == that.end && Double.compare(timeStart, that.timeStart) == 0 && Double.compare(timeEnd, that.timeEnd) == 0 && Objects.equals(value, that.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(begin, end, timeStart, timeEnd, value);
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", AudioToken.class.getSimpleName() + "[", "]")
                .add("begin=" + begin)
                .add("end=" + end)
                .add("timeStart=" + timeStart)
                .add("timeEnd=" + timeEnd)
                .add("value='" + value + "'")
                .toString();
    }
}
