Add api football files updater
This commit is contained in:
@@ -17,6 +17,8 @@ public class APIFootballMatch extends BaseMatch {
|
||||
private int matchId;
|
||||
private int leagueId;
|
||||
private String matchStatus;
|
||||
private String teamNameHome;
|
||||
private String teamNameGuest;
|
||||
|
||||
public APIFootballMatch(JSONObject json, int season) {
|
||||
this.season = season;
|
||||
@@ -25,6 +27,8 @@ public class APIFootballMatch extends BaseMatch {
|
||||
this.leagueId = Integer.parseInt(json.get("league_id").toString());
|
||||
this.teamIdHome = Integer.parseInt(((JSONObject) json.get("homeTeam")).get("team_id").toString());
|
||||
this.teamIdGuest = Integer.parseInt(((JSONObject) json.get("awayTeam")).get("team_id").toString());
|
||||
this.teamNameHome = ((JSONObject) json.get("homeTeam")).get("team_name").toString();
|
||||
this.teamNameGuest = ((JSONObject) json.get("awayTeam")).get("team_name").toString();
|
||||
this.goalsHome = getNumberOrNull(json.get("goalsHomeTeam"));
|
||||
this.goalsGuest = getNumberOrNull(json.get("goalsAwayTeam"));
|
||||
this.matchday = getMatchdayFromRoundString(json.get("round").toString(), this.leagueId);
|
||||
@@ -73,4 +77,12 @@ public class APIFootballMatch extends BaseMatch {
|
||||
private Integer getNumberOrNull(Object object) {
|
||||
return object != null ? Integer.parseInt(object.toString()) : null;
|
||||
}
|
||||
|
||||
public String getTeamNameHome() {
|
||||
return this.teamNameHome;
|
||||
}
|
||||
|
||||
public String getTeamNameGuest() {
|
||||
return this.teamNameGuest;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user