mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-10 04:51:07 +00:00
externed inner classes of RefattaAPI
This commit is contained in:
1 parent
faef750d49
commit
b2af511ca5
11 files changed
+237
-207
No files matched your search
+116
@@ -0,0 +1,116 @@
|
||||
package com.sap.sailing.selenium.api.regatta;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.selenium.api.core.JsonWrapper;
|
||||
|
||||
public class Competitor extends JsonWrapper {
|
||||
|
||||
public Competitor(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return UUID.fromString(get("id"));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return get("shortName");
|
||||
}
|
||||
|
||||
public String getNationality() {
|
||||
return get("nationality");
|
||||
}
|
||||
|
||||
public String getNationalityISO2() {
|
||||
return get("nationalityISO2");
|
||||
}
|
||||
|
||||
public String getNationalityISO3() {
|
||||
return get("nationalityISO3");
|
||||
}
|
||||
|
||||
public Team getTeam() {
|
||||
return new Team(get("team"));
|
||||
}
|
||||
|
||||
public Boat getBoat() {
|
||||
return new Boat(get("boat"));
|
||||
}
|
||||
|
||||
public class Team extends JsonWrapper {
|
||||
|
||||
public Team(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getNationality() {
|
||||
return (String) ((JSONObject) get("nationality")).get("IOC");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class Boat extends JsonWrapper {
|
||||
|
||||
public Boat(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return UUID.fromString(get("id"));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getSailId() {
|
||||
return get("sailId");
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return get("color");
|
||||
}
|
||||
|
||||
public BoatClass getBoatClass() {
|
||||
return new BoatClass(get("boatClass"));
|
||||
}
|
||||
}
|
||||
|
||||
public class BoatClass extends JsonWrapper {
|
||||
|
||||
public BoatClass(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return get("displayName");
|
||||
}
|
||||
|
||||
public Boolean getTypciallyStartsUpwind() {
|
||||
return get("typicallyStartsUpwind");
|
||||
}
|
||||
|
||||
public Double getHullLengthInMeters() {
|
||||
return get("hullLengthInMeters");
|
||||
}
|
||||
|
||||
public Double getHullBeamInMeters() {
|
||||
return get("hullBeamInMeters");
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.sap.sailing.selenium.api.regatta;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.selenium.api.core.JsonWrapper;
|
||||
|
||||
public class RaceColumn extends JsonWrapper {
|
||||
|
||||
public RaceColumn(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getSeriesName() {
|
||||
return get("seriesname");
|
||||
}
|
||||
|
||||
public String getRaceName() {
|
||||
return get("racename");
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.sap.sailing.selenium.api.regatta;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.selenium.api.core.JsonWrapper;
|
||||
|
||||
public class RaceNameWithId extends JsonWrapper {
|
||||
|
||||
public RaceNameWithId(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return get("id");
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.sap.sailing.selenium.api.regatta;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.common.CompetitorRegistrationType;
|
||||
import com.sap.sailing.selenium.api.core.JsonWrapper;
|
||||
|
||||
public class Regatta extends JsonWrapper {
|
||||
|
||||
public Regatta(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return get("startDate");
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return get("endDate");
|
||||
}
|
||||
|
||||
public String getBoatClass() {
|
||||
return get("boatclass");
|
||||
}
|
||||
|
||||
public String getScoringSystem() {
|
||||
return get("scoringSystem");
|
||||
}
|
||||
|
||||
public String getCourseAreaId() {
|
||||
return get("courseAreaId");
|
||||
}
|
||||
|
||||
public Boolean canBoatsOfCompetitorsChangePerRace() {
|
||||
return get("canBoatsOfCompetitorsChangePerRace");
|
||||
}
|
||||
|
||||
public CompetitorRegistrationType getCompetitorRegistrationType() {
|
||||
return CompetitorRegistrationType.valueOf(get("competitorRegistrationType"));
|
||||
}
|
||||
}
|
||||
-196
@@ -1,6 +1,5 @@
|
||||
package com.sap.sailing.selenium.api.regatta;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.TreeMap;
|
||||
@@ -9,9 +8,7 @@ import java.util.UUID;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.common.CompetitorRegistrationType;
|
||||
import com.sap.sailing.selenium.api.core.ApiContext;
|
||||
import com.sap.sailing.selenium.api.core.JsonWrapper;
|
||||
|
||||
public class RegattaApi {
|
||||
|
||||
@@ -80,197 +77,4 @@ public class RegattaApi {
|
||||
return result;
|
||||
}
|
||||
|
||||
public class Regatta extends JsonWrapper {
|
||||
|
||||
public Regatta(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return get("startDate");
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return get("endDate");
|
||||
}
|
||||
|
||||
public String getBoatClass() {
|
||||
return get("boatclass");
|
||||
}
|
||||
|
||||
public String getScoringSystem() {
|
||||
return get("scoringSystem");
|
||||
}
|
||||
|
||||
public String getCourseAreaId() {
|
||||
return get("courseAreaId");
|
||||
}
|
||||
|
||||
public Boolean canBoatsOfCompetitorsChangePerRace() {
|
||||
return get("canBoatsOfCompetitorsChangePerRace");
|
||||
}
|
||||
|
||||
public CompetitorRegistrationType getCompetitorRegistrationType() {
|
||||
return CompetitorRegistrationType.valueOf(get("competitorRegistrationType"));
|
||||
}
|
||||
}
|
||||
|
||||
public class Competitor extends JsonWrapper {
|
||||
|
||||
public Competitor(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return UUID.fromString(get("id"));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return get("shortName");
|
||||
}
|
||||
|
||||
public String getNationality() {
|
||||
return get("nationality");
|
||||
}
|
||||
|
||||
public String getNationalityISO2() {
|
||||
return get("nationalityISO2");
|
||||
}
|
||||
|
||||
public String getNationalityISO3() {
|
||||
return get("nationalityISO3");
|
||||
}
|
||||
|
||||
public Team getTeam() {
|
||||
return new Team(get("team"));
|
||||
}
|
||||
|
||||
public Boat getBoat() {
|
||||
return new Boat(get("boat"));
|
||||
}
|
||||
}
|
||||
|
||||
public class Team extends JsonWrapper {
|
||||
|
||||
public Team(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getNationality() {
|
||||
return (String) ((JSONObject) get("nationality")).get("IOC");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class Boat extends JsonWrapper {
|
||||
|
||||
public Boat(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return UUID.fromString(get("id"));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getSailId() {
|
||||
return get("sailId");
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return get("color");
|
||||
}
|
||||
|
||||
public BoatClass getBoatClass() {
|
||||
return new BoatClass(get("boatClass"));
|
||||
}
|
||||
}
|
||||
|
||||
public class BoatClass extends JsonWrapper {
|
||||
|
||||
public BoatClass(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return get("displayName");
|
||||
}
|
||||
|
||||
public Boolean getTypciallyStartsUpwind() {
|
||||
return get("typicallyStartsUpwind");
|
||||
}
|
||||
|
||||
public Double getHullLengthInMeters() {
|
||||
return get("hullLengthInMeters");
|
||||
}
|
||||
|
||||
public Double getHullBeamInMeters() {
|
||||
return get("hullBeamInMeters");
|
||||
}
|
||||
}
|
||||
|
||||
public class RaceColumn extends JsonWrapper {
|
||||
|
||||
public RaceColumn(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getSeriesName() {
|
||||
return get("seriesname");
|
||||
}
|
||||
|
||||
public String getRaceName() {
|
||||
return get("racename");
|
||||
}
|
||||
}
|
||||
|
||||
public class RaceNameWithId extends JsonWrapper {
|
||||
|
||||
public RaceNameWithId(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return get("id");
|
||||
}
|
||||
}
|
||||
|
||||
public class RegattaRaces extends JsonWrapper {
|
||||
|
||||
public RegattaRaces(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getRegattaName() {
|
||||
return get("regatta");
|
||||
}
|
||||
|
||||
public RaceNameWithId[] getRaces() {
|
||||
RaceNameWithId[] array = getArray("races", RaceNameWithId.class);
|
||||
return array;
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.sap.sailing.selenium.api.regatta;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.selenium.api.core.JsonWrapper;
|
||||
|
||||
public class RegattaRaces extends JsonWrapper {
|
||||
|
||||
private static final String ATTRIBUTE_REGATTA_NAME = "regatta";
|
||||
private static final String ATTRIBUTE_RACES = "races";
|
||||
public RegattaRaces(JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public String getRegattaName() {
|
||||
return get(ATTRIBUTE_REGATTA_NAME);
|
||||
}
|
||||
|
||||
public RaceNameWithId[] getRaces() {
|
||||
RaceNameWithId[] array = getArray(ATTRIBUTE_RACES, RaceNameWithId.class);
|
||||
return array;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -19,9 +19,9 @@ import com.sap.sailing.domain.common.CompetitorRegistrationType;
|
||||
import com.sap.sailing.selenium.api.core.ApiContext;
|
||||
import com.sap.sailing.selenium.api.event.EventApi;
|
||||
import com.sap.sailing.selenium.api.event.EventApi.Event;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi.Competitor;
|
||||
import com.sap.sailing.selenium.api.event.SecurityApi;
|
||||
import com.sap.sailing.selenium.api.regatta.Competitor;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
|
||||
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
|
||||
|
||||
+1
-1
@@ -18,8 +18,8 @@ import com.sap.sailing.selenium.api.core.ApiContext;
|
||||
import com.sap.sailing.selenium.api.event.EventApi;
|
||||
import com.sap.sailing.selenium.api.event.LeaderboardApi;
|
||||
import com.sap.sailing.selenium.api.event.LeaderboardApi.DeviceMappingRequest;
|
||||
import com.sap.sailing.selenium.api.regatta.Competitor;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi.Competitor;
|
||||
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
|
||||
public class LeaderboardApiTest extends AbstractSeleniumTest {
|
||||
|
||||
+1
-1
@@ -12,8 +12,8 @@ import com.sap.sailing.selenium.api.core.ApiContext;
|
||||
import com.sap.sailing.selenium.api.event.EventApi;
|
||||
import com.sap.sailing.selenium.api.event.MarkApi;
|
||||
import com.sap.sailing.selenium.api.event.MarkApi.Mark;
|
||||
import com.sap.sailing.selenium.api.regatta.Regatta;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi.Regatta;
|
||||
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
|
||||
public class MarkApiTest extends AbstractSeleniumTest {
|
||||
|
||||
+3
-3
@@ -24,10 +24,10 @@ import com.sap.sailing.selenium.api.event.LeaderboardApi;
|
||||
import com.sap.sailing.selenium.api.event.LeaderboardApi.DeviceMappingRequest;
|
||||
import com.sap.sailing.selenium.api.event.MarkApi;
|
||||
import com.sap.sailing.selenium.api.event.MarkApi.Mark;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi.Competitor;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi.RaceColumn;
|
||||
import com.sap.sailing.selenium.api.event.SecurityApi;
|
||||
import com.sap.sailing.selenium.api.regatta.Competitor;
|
||||
import com.sap.sailing.selenium.api.regatta.RaceColumn;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
|
||||
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
|
||||
|
||||
+4
-4
@@ -15,11 +15,11 @@ import org.junit.Test;
|
||||
import com.sap.sailing.selenium.api.core.ApiContext;
|
||||
import com.sap.sailing.selenium.api.event.EventApi;
|
||||
import com.sap.sailing.selenium.api.event.LeaderboardApi;
|
||||
import com.sap.sailing.selenium.api.regatta.Competitor;
|
||||
import com.sap.sailing.selenium.api.regatta.RaceColumn;
|
||||
import com.sap.sailing.selenium.api.regatta.Regatta;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi.Competitor;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi.RaceColumn;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi.Regatta;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaApi.RegattaRaces;
|
||||
import com.sap.sailing.selenium.api.regatta.RegattaRaces;
|
||||
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
|
||||
public class RegattaApiTest extends AbstractSeleniumTest {
|
||||
|
||||
Reference in new issue
Block a user