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

import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Objects;
import java.util.StringJoiner;

public abstract class Protocol {
    LocalDate       date;
    LocalTime       startTime;
    LocalTime       endTime;
    Integer         index;
    String          titel;
    String          place;
    Integer         wp;

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public LocalTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalTime startTime) {
        this.startTime = startTime;
    }

    public LocalTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalTime endTime) {
        this.endTime = endTime;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public String getTitel() {
        return titel;
    }

    public void setTitel(String titel) {
        this.titel = titel;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public Integer getWp() {
        return wp;
    }

    public void setWp(Integer wp) {
        this.wp = wp;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Protocol protocol)) return false;
        return Objects.equals(date, protocol.date) && Objects.equals(startTime, protocol.startTime)
                && Objects.equals(endTime, protocol.endTime) && Objects.equals(index, protocol.index)
                && Objects.equals(titel, protocol.titel) && Objects.equals(place, protocol.place) && Objects.equals(wp, protocol.wp);
    }

    @Override
    public int hashCode() {
        return Objects.hash(date, startTime, endTime, index, titel, place, wp);
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", Protocol.class.getSimpleName() + "[", "]")
                .add("date=" + date)
                .add("starttime=" + startTime)
                .add("endtime=" + endTime)
                .add("index=" + index)
                .add("titel='" + titel + "'")
                .add("place='" + place + "'")
                .add("wp=" + wp)
                .toString();
    }
}

