use of org.opentripplanner.api.model.ApiAlert in project OpenTripPlanner by opentripplanner.
the class AlertMapper method mapToApi.
ApiAlert mapToApi(TransitAlert domain) {
ApiAlert api = new ApiAlert();
if (domain.alertHeaderText != null) {
api.alertHeaderText = domain.alertHeaderText.toString(locale);
}
if (domain.alertDescriptionText != null) {
api.alertDescriptionText = domain.alertDescriptionText.toString(locale);
}
if (domain.alertUrl != null) {
api.alertUrl = domain.alertUrl.toString(locale);
}
api.effectiveStartDate = domain.getEffectiveStartDate();
api.effectiveEndDate = domain.getEffectiveEndDate();
return api;
}
use of org.opentripplanner.api.model.ApiAlert in project OpenTripPlanner by opentripplanner.
the class StreetNoteMaperMapper method mapToApi.
ApiAlert mapToApi(StreetNote domain) {
ApiAlert api = new ApiAlert();
if (domain.note != null) {
api.alertHeaderText = domain.note.toString(locale);
}
if (domain.descriptionText != null) {
api.alertDescriptionText = domain.descriptionText.toString(locale);
}
if (domain.url != null) {
api.alertUrl = domain.url;
}
api.effectiveStartDate = domain.effectiveStartDate;
api.effectiveEndDate = domain.effectiveEndDate;
return api;
}
Aggregations