Search in sources :

Example 1 with ApiTripShort

use of org.opentripplanner.api.model.ApiTripShort in project OpenTripPlanner by opentripplanner.

the class TripMapper method mapToApiShort.

public static ApiTripShort mapToApiShort(Trip domain) {
    if (domain == null) {
        return null;
    }
    ApiTripShort api = new ApiTripShort();
    api.id = FeedScopedIdMapper.mapToApi(domain.getId());
    api.tripHeadsign = domain.getTripHeadsign();
    api.serviceId = FeedScopedIdMapper.mapToApi(domain.getServiceId());
    FeedScopedId shape = domain.getShapeId();
    // TODO OTP2 - All ids should be fully qualified including feed scope id.
    api.shapeId = shape == null ? null : shape.getId();
    api.direction = domain.getDirection().gtfsCode;
    return api;
}
Also used : FeedScopedId(org.opentripplanner.model.FeedScopedId) ApiTripShort(org.opentripplanner.api.model.ApiTripShort)

Aggregations

ApiTripShort (org.opentripplanner.api.model.ApiTripShort)1 FeedScopedId (org.opentripplanner.model.FeedScopedId)1