package de.jeyp91.tippliga;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 */
public class TLWTeam {

    private int season;
    private int league;
    private int teamId;
    private String teamName;
    private String teamNameShort;
    private String teamSymbol;
    private String groupId;
    private int matchday;

    public TLWTeam(ResultSet rset) {
        final int SEASON = 1;
        final int LEAGUE = 2;
        final int TEAM_ID = 3;
        final int TEAM_NAME = 4;
        final int TEAM_NAME_SHORT = 5;
        final int TEAM_SYMBOL = 6;
        final int GROUP_ID = 7;
        final int MATCHDAY = 8;

        try {
            this.season = Integer.parseInt(rset.getString(SEASON));
            this.league = Integer.parseInt(rset.getString(LEAGUE));
            this.teamId = Integer.parseInt(rset.getString(TEAM_ID));
            this.teamName = rset.getString(TEAM_NAME);
            this.teamNameShort = rset.getString(TEAM_NAME_SHORT);
            this.teamSymbol = rset.getString(TEAM_SYMBOL);
            this.groupId = rset.getString(GROUP_ID);
            this.matchday = Integer.parseInt(rset.getString(MATCHDAY));
        } catch (SQLException e) {
            /* TODO */
            e.printStackTrace();
        }
    }

    public TLWTeam(
            int season, int league, int teamId,
            String teamName, String teamNameShort, String teamSymbol, String groupId,
            int matchday
    ) {
        this.season = season;
        this.league = league;
        this.teamId = teamId;
        this.teamName = teamName;
        this.teamNameShort = teamNameShort;
        this.teamSymbol = teamSymbol;
        this.groupId = groupId;
        this.matchday = matchday;
    }

    public int getSeason() {
        return this.season;
    }

    public int getLeague() {
        return this.league;
    }

    public int getTeamId() {
        return this.teamId;
    }

    public String getTeamName() {
        return this.teamName;
    }

    public String getTeamNameShort() {
        return this.teamNameShort;
    }

    public String getTeamSymbol() {
        return this.teamSymbol;
    }

    public String getGroupId() {
        return this.groupId;
    }

    public int getMatchday() {
        return this.matchday;
    }
}