de.aipark.api.requestsResponse.getOptimalTrip.GetOptimalTripResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aipark-api Show documentation
Show all versions of aipark-api Show documentation
AIPARK offers detailed parking information for more than 1.8 Mio parking areas in Germany
with nationwide coverage. Additionally, accurate occupancy predictions are derived using data from
a network of more than 5 million smartphones. Use the AIPARK API Explorer application to try out and
test the interface. Please send a request via email if you are a developer and require an API key.
We'll be in touch with you shortly. This application is provided via a demo backend environment.
Please note that API load tests do not reflect the performance of the productive system.
Mail: [email protected]
package de.aipark.api.requestsResponse.getOptimalTrip;
import de.aipark.api.optimalTrip.OptimalTrip;
import de.aipark.api.optimalTrip.Situation;
import de.aipark.api.parkingarea.MapEntry;
import io.swagger.annotations.ApiModelProperty;
import java.util.ResourceBundle;
/**
* Created by torgen on 14.12.17.
*/
public class GetOptimalTripResponse {
@ApiModelProperty(value = "optimal trips with priority, higher value means higher priority")
private MapEntry optimalTrips;
private Situation situation;
public GetOptimalTripResponse() {
optimalTrips = new MapEntry();
}
public GetOptimalTripResponse(MapEntry optimalTrips, Situation situation) {
this.optimalTrips = optimalTrips;
this.situation = situation;
}
public MapEntry getOptimalTrips() {
return optimalTrips;
}
public void setOptimalTrips(MapEntry optimalTrips) {
this.optimalTrips = optimalTrips;
}
public Situation getSituation() {
return situation;
}
public void setSituation(Situation situation) {
this.situation = situation;
}
@Override
public String toString() {
ResourceBundle bundle = ResourceBundle.getBundle( "Api" );
String result = "";
switch (situation){
case GOOD:
result += bundle.getString("goodSituation");
break;
case MIDDLE:
result += bundle.getString("middleSituation");
break;
case BAD:
result += bundle.getString("badSituation");
break;
case UNKNOWN:
result += bundle.getString("unknownSituation");
break;
}
if(optimalTrips.getEntryList().size() < 1){
result += ", " + bundle.getString("noAreasNearToDestination");
}
else if(!situation.equals(Situation.UNKNOWN)){
result += ", " + optimalTrips.getEntryList().get(0).getValue().toString();
}
result += ".";
return result;
}
}