All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.aipark.api.requestsResponse.getOptimalTrip.GetOptimalTripResponse Maven / Gradle / Ivy

Go to download

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]

There is a newer version: 30.06
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy