Package org.onebusaway.api.model.transit.service_alerts

Examples of org.onebusaway.api.model.transit.service_alerts.SituationConsequenceV2Bean


    }

    if (!CollectionsLibrary.isEmpty(situation.getConsequences())) {
      List<SituationConsequenceV2Bean> beans = new ArrayList<SituationConsequenceV2Bean>();
      for (SituationConsequenceBean consequence : situation.getConsequences()) {
        SituationConsequenceV2Bean consequenceBean = getSituationConsequence(consequence);
        beans.add(consequenceBean);
      }
      bean.setConsequences(beans);
    }
View Full Code Here


  }

  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;
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.api.model.transit.service_alerts.SituationConsequenceV2Bean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.