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

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

public class Membership {
    String      role;
    String      member;     // TODO: wozu? Dr. Abrami hat hier die ID des Parlamentariers gespeichert
    LocalDate   begin;        // TODO: in Mongo eigentlich Date?
    LocalDate   end;        // TODO: in Mongo eigentlich Date?
    String      label;
    Integer     wp;

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getMember() {
        return member;
    }

    public void setMember(String member) {
        this.member = member;
    }

    public LocalDate getBegin() {
        return begin;
    }

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

    public LocalDate getEnd() {
        return end;
    }

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

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    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 Membership that)) return false;
        return Objects.equals(role, that.role) && Objects.equals(member, that.member) && Objects.equals(begin, that.begin) && Objects.equals(end, that.end) && Objects.equals(label, that.label) && Objects.equals(wp, that.wp);
    }

    @Override
    public int hashCode() {
        return Objects.hash(role, member, begin, end, label, wp);
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", Membership.class.getSimpleName() + "[", "]")
                .add("role='" + role + "'")
                .add("member='" + member + "'")
                .add("begin=" + begin)
                .add("end=" + end)
                .add("label='" + label + "'")
                .add("wp=" + wp)
                .toString();
    }
}
