package com.example.scores.utilities;

public class Score {
    private String team1;
    private String team2;
    private String time;
    private int team1Score;
    private int team2Score;

    public Score(String team1, String team2) {
        this.team1 = team1;
        this.team2 = team2;
    }

    public String getTeam1() {
        return team1;
    }

    public void setTeam1(String team1) {
        this.team1 = team1;
    }

    public String getTeam2() {
        return team2;
    }

    public void setTeam2(String team2) {
        this.team2 = team2;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public int getTeam1Score() {
        return team1Score;
    }

    public void setTeam1Score(int team1Score) {
        this.team1Score = team1Score;
    }

    public int getTeam2Score() {
        return team2Score;
    }

    public void setTeam2Score(int team2Score) {
        this.team2Score = team2Score;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    private String description;

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result
                + ((description == null) ? 0 : description.hashCode());
        result = prime * result
                + ((team1 == null) ? 0 : team1.hashCode());
        result = prime * result + team1Score;
        result = prime * result
                + ((team2 == null) ? 0 : team2.hashCode());
        result = prime * result + team2Score;
        result = prime * result
                + ((time == null) ? 0 : time.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Score other = (Score) obj;
        if (description == null) {
            if (other.description != null)
                return false;
        }
        else if (!description.equals(other.description))
            return false;
        if (team1 == null) {
            if (other.team1 != null)
                return false;
        }
        else if (!team1.equals(other.team1))
            return false;
        if (team1Score != other.team1Score)
            return false;
        if (team2 == null) {
            if (other.team2 != null)
                return false;
        }
        else if (!team2.equals(other.team2))
            return false;
        if (team2Score != other.team2Score)
            return false;
        if (time == null) {
            if (other.time != null)
                return false;
        }
        else if (!time.equals(other.time))
            return false;
        return true;
    }

    @Override
    public String toString() {
        return team1 + " " + team1Score + " , " + team2 + " " + team2Score + "\n" + description;
    }
}
