Clean up shit

This commit is contained in:
2020-10-04 12:23:43 +02:00
parent e57f79c18b
commit 557cd59c8f
14 changed files with 300 additions and 68 deletions

View File

@@ -11,7 +11,7 @@ import de.jeyp91.openligadb.OpenLigaDBMatch;
/**
*
*/
public class TLWMatch extends BaseMatch {
public class TLWMatch extends BaseMatch{
public final Integer STATUS_NOTSTARTED = 0;
public final Integer STATUS_STARTED = 1;
@@ -94,8 +94,8 @@ public class TLWMatch extends BaseMatch {
this.league = league;
this.matchday = matchday;
this.matchNo = matchNo;
this.teamIdHome = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(oldbmatch.getTeamIdHome());
this.teamIdGuest = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(oldbmatch.getTeamIdGuest());
this.teamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(oldbmatch.getTeamIdHome());
this.teamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(oldbmatch.getTeamIdGuest());
this.goalsHome = oldbmatch.getGoalsHome();
this.goalsGuest = oldbmatch.getGoalsGuest();
this.matchDatetime = oldbmatch.getMatchDateTime().replace("T", " ");
@@ -105,16 +105,16 @@ public class TLWMatch extends BaseMatch {
this.status = 0;
}
public TLWMatch(APIFootballMatch APIFootballMatch, int season, int league, int matchday, int matchNo, int status, int koMatch) {
public TLWMatch(APIFootballMatch apiFootballMatch, int season, int league, int matchday, int matchNo, int status, int koMatch) {
this.season = season;
this.league = league;
this.matchday = matchday;
this.matchNo = matchNo;
this.teamIdHome = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(APIFootballMatch.getTeamIdHome());
this.teamIdGuest = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(APIFootballMatch.getTeamIdGuest());
this.goalsHome = APIFootballMatch.getGoalsHome();
this.goalsGuest = APIFootballMatch.getGoalsGuest();
this.matchDatetime = APIFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19);
this.teamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdHome());
this.teamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdGuest());
this.goalsHome = apiFootballMatch.getGoalsHome();
this.goalsGuest = apiFootballMatch.getGoalsGuest();
this.matchDatetime = apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19);
this.groupId = "";
this.formulaHome = "";
this.formulaGuest = "";
@@ -143,6 +143,31 @@ public class TLWMatch extends BaseMatch {
this.status = 0;
}
public TLWMatch(TLWMatch referenceMatch) {
this.season = referenceMatch.season;
this.league = referenceMatch.league;
this.matchday = referenceMatch.matchday;
this.teamIdHome = referenceMatch.teamIdHome;
this.teamIdGuest = referenceMatch.teamIdGuest;
this.goalsHome = referenceMatch.goalsHome;
this.goalsGuest = referenceMatch.goalsGuest;
this.matchDatetime = referenceMatch.matchDatetime;
this.matchNo = referenceMatch.matchNo;
this.groupId = referenceMatch.groupId;
this.formulaHome = referenceMatch.formulaHome;
this.formulaGuest = referenceMatch.formulaGuest;
this.status = referenceMatch.status;
this.koMatch = referenceMatch.koMatch;
this.goalsOvertimeHome = referenceMatch.goalsOvertimeHome;
this.goalsOvertimeGuest = referenceMatch.goalsOvertimeGuest;
this.showTable = referenceMatch.showTable;
this.trend = referenceMatch.trend;
this.odd1 = referenceMatch.odd1;
this.oddX = referenceMatch.oddX;
this.odd2 = referenceMatch.odd2;
this.rating = referenceMatch.rating;
}
public Integer getSeason() {
return this.season;
}
@@ -229,4 +254,20 @@ public class TLWMatch extends BaseMatch {
private String nullToSqlEmptyString(String string) {
return string != null ? "'"+string+"'" : "''";
}
public void setStatus(int status) {
this.status = status;
}
public void setMatchDateTime(String matchDateTime) {
this.matchDatetime = matchDateTime;
}
public void updateMatch(APIFootballMatch apiFootballMatch) {
this.teamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdHome());
this.teamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdGuest());
this.goalsHome = apiFootballMatch.getGoalsHome();
this.goalsGuest = apiFootballMatch.getGoalsGuest();
this.matchDatetime = apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19);
}
}