class BestTransportResult {

	public String routeToShortString() {
		if (this.route != null && this.route.legs != null && this.route.legs[0] != null) {
			DirectionsLeg leg = this.route.legs[0];
			StringBuilder builder = new StringBuilder();
			switch (this.mode) {
			case DRIVING:
				if (leg.durationInTraffic != null) {
					return builder.append(THE_ROUTE_IS).append(leg.distance.humanReadable).append(LONG_AND_NEED)
							.append(leg.durationInTraffic.humanReadable).append(" time in traffic").toString();
				}
				return builder.append(THE_ROUTE_IS).append(leg.distance.humanReadable).append(LONG_AND_NEED)
						.append(leg.duration.humanReadable).append(" time").toString();
			case TRANSIT:
				int i = 0;
				while (leg.steps[i].transitDetails == null) {
					i++;
				}
				if (i > 0) {
					return builder.append("You should go at ").append(leg.departureTime.toString(TIME_FORMAT))
							.append(". departure time of the first public transport is ")
							.append(leg.steps[i].transitDetails.departureTime.toString(TIME_FORMAT))
							.append(" at the station ").append(leg.steps[i].transitDetails.departureStop.name)
							.append(" with line ").append(leg.steps[i].transitDetails.line.shortName).append(" to ")
							.append(leg.steps[i].transitDetails.headsign).append(". The arrival time is ")
							.append(leg.arrivalTime.toString(TIME_FORMAT)).toString();
				}
				return builder.append("Departure is ").append(leg.departureTime.toString(TIME_FORMAT)).append(" at ")
						.append(leg.steps[i].transitDetails.departureStop.name).append(" with line ")
						.append(leg.steps[i].transitDetails.line.shortName).append(" to ")
						.append(leg.steps[i].transitDetails.headsign).append(", arrival time is ")
						.append(leg.arrivalTime.toString(TIME_FORMAT)).toString();
			case BICYCLING:
				return builder.append(THE_ROUTE_IS).append(leg.distance.humanReadable).append(LONG_AND_NEED)
						.append(leg.duration.humanReadable).append(" time").toString();
			default:
				break;
			}
		}
		return "No route found";
	}

	public  BestTransportResult();
	public  BestTransportResult(TravelMode mode, DirectionsRoute route);

}