mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 08:49:58 +00:00
Implement toShortString() for all result classes.
This commit is contained in:
parent
d0e19dbd7a
commit
fab11c0957
4 changed files with 29 additions and 0 deletions
|
@ -59,4 +59,11 @@ public final class NearbyLocationsResult implements Serializable {
|
||||||
helper.add("size", locations.size()).add("locations", locations);
|
helper.add("size", locations.size()).add("locations", locations);
|
||||||
return helper.toString();
|
return helper.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toShortString() {
|
||||||
|
if (status == Status.OK)
|
||||||
|
return locations.size() + " locations";
|
||||||
|
else
|
||||||
|
return status.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,4 +68,11 @@ public final class QueryDeparturesResult implements Serializable {
|
||||||
helper.add("size", stationDepartures.size()).add("stationDepartures", stationDepartures);
|
helper.add("size", stationDepartures.size()).add("stationDepartures", stationDepartures);
|
||||||
return helper.toString();
|
return helper.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toShortString() {
|
||||||
|
if (status == Status.OK)
|
||||||
|
return stationDepartures.size() + " stationDepartures";
|
||||||
|
else
|
||||||
|
return status.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,4 +113,12 @@ public final class QueryTripsResult implements Serializable {
|
||||||
}
|
}
|
||||||
return helper.toString();
|
return helper.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toShortString() {
|
||||||
|
if (status == Status.OK)
|
||||||
|
return trips.size() + " trips" + (from != null ? " from " + from : "") + (via != null ? " via " + via : "")
|
||||||
|
+ (to != null ? " to " + to : "");
|
||||||
|
else
|
||||||
|
return status.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,4 +71,11 @@ public final class SuggestLocationsResult implements Serializable {
|
||||||
helper.add("size", suggestedLocations.size()).add("suggestedLocations", suggestedLocations);
|
helper.add("size", suggestedLocations.size()).add("suggestedLocations", suggestedLocations);
|
||||||
return helper.toString();
|
return helper.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toShortString() {
|
||||||
|
if (status == Status.OK)
|
||||||
|
return suggestedLocations.size() + " locations";
|
||||||
|
else
|
||||||
|
return status.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue