Package com.google.transit.realtime.GtfsRealtime

Examples of com.google.transit.realtime.GtfsRealtime.TranslatedString


    for (ServiceAlert serviceAlert : serviceAlerts) {

      Alert.Builder alert = Alert.newBuilder();

      if (serviceAlert.hasSummary()) {
        TranslatedString translated = convertTranslatedString(serviceAlert.getSummary());
        alert.setHeaderText(translated);
      }

      if (serviceAlert.hasDescription()) {
        TranslatedString translated = convertTranslatedString(serviceAlert.getDescription());
        alert.setDescriptionText(translated);
      }

      for (TimeRange range : serviceAlert.getActiveWindowList()) {
        com.google.transit.realtime.GtfsRealtime.TimeRange.Builder timeRange = com.google.transit.realtime.GtfsRealtime.TimeRange.newBuilder();
View Full Code Here


      }
      {
        EntitySelector affects = alert.getInformedEntity(1);
        assertEquals("2", affects.getAgencyId());
      }
      TranslatedString header = alert.getHeaderText();
      assertEquals(2, header.getTranslationCount());
      {
        Translation translation = header.getTranslation(0);
        assertEquals("Name", translation.getText());
        assertEquals("en", translation.getLanguage());
      }
      {
        Translation translation = header.getTranslation(1);
        assertEquals("Nombre", translation.getText());
        assertEquals("es", translation.getLanguage());
      }
      TranslatedString description = alert.getDescriptionText();
      assertEquals(2, description.getTranslationCount());
      {
        Translation translation = description.getTranslation(0);
        assertEquals("Description", translation.getText());
        assertEquals("en", translation.getLanguage());
      }
      {
        Translation translation = description.getTranslation(1);
        assertEquals("Descripción", translation.getText());
        assertEquals("es", translation.getLanguage());
      }
    }
    {
View Full Code Here

TOP

Related Classes of com.google.transit.realtime.GtfsRealtime.TranslatedString

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.