Search in sources :

Example 1 with SituationConditionDetailsV2Bean

use of org.onebusaway.api.model.transit.service_alerts.SituationConditionDetailsV2Bean in project onebusaway-application-modules by camsys.

the class BeanFactoryV2 method getSituationConsequence.

private SituationConsequenceV2Bean getSituationConsequence(SituationConsequenceBean consequence) {
    SituationConsequenceV2Bean bean = new SituationConsequenceV2Bean();
    if (consequence.getEffect() != null)
        bean.setCondition(consequence.getEffect().toString().toLowerCase());
    if (_includeConditionDetails && (consequence.getDetourPath() != null || !CollectionsLibrary.isEmpty(consequence.getDetourStopIds()))) {
        SituationConditionDetailsV2Bean detailsBean = new SituationConditionDetailsV2Bean();
        if (consequence.getDetourPath() != null) {
            EncodedPolylineBean poly = new EncodedPolylineBean();
            poly.setPoints(consequence.getDetourPath());
            detailsBean.setDiversionPath(poly);
        }
        detailsBean.setDiversionStopIds(consequence.getDetourStopIds());
        bean.setConditionDetails(detailsBean);
    }
    return bean;
}
Also used : SituationConditionDetailsV2Bean(org.onebusaway.api.model.transit.service_alerts.SituationConditionDetailsV2Bean) SituationConsequenceV2Bean(org.onebusaway.api.model.transit.service_alerts.SituationConsequenceV2Bean) EncodedPolylineBean(org.onebusaway.geospatial.model.EncodedPolylineBean)

Aggregations

SituationConditionDetailsV2Bean (org.onebusaway.api.model.transit.service_alerts.SituationConditionDetailsV2Bean)1 SituationConsequenceV2Bean (org.onebusaway.api.model.transit.service_alerts.SituationConsequenceV2Bean)1 EncodedPolylineBean (org.onebusaway.geospatial.model.EncodedPolylineBean)1