Page MenuHomeGitPull.it

D50.1765105276.diff
No OneTemporary

Size
1012 KB
Referenced Files
None
Subscribers
None

D50.1765105276.diff

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -20,7 +20,7 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
- android:theme="@style/AppTheme">
+ android:theme="@style/AppTheme.NoActionBar">
<activity
android:name=".ActivityMain"
android:label="@string/app_name"
@@ -99,15 +99,19 @@
android:value=".ActivityMain"/>
</activity>
+ <activity android:name=".ActivityPrincipal"
+ android:label="Principal" >
+ </activity>
+
<provider
- android:name=".middleware.AppDataProvider"
+ android:name=".data.AppDataProvider"
android:authorities="it.reyboz.bustorino.provider"
android:enabled="true"
android:exported="false">
</provider>
<service
- android:name=".middleware.DatabaseUpdateService"
+ android:name=".data.DatabaseUpdateService"
android:exported="false">
</service>
<!-- Don't show the additional frame on samsung phones -->
diff --git a/build.gradle b/build.gradle
--- a/build.gradle
+++ b/build.gradle
@@ -101,6 +101,8 @@
// ACRA
implementation "ch.acra:acra-mail:$acra_version"
implementation "ch.acra:acra-dialog:$acra_version"
+ // google transit realtime
+ implementation 'com.google.protobuf:protobuf-java:3.14.0'
}
}
diff --git a/res/drawable/ic_baseline_departure_board_24.xml b/res/drawable/ic_baseline_departure_board_24.xml
new file mode 100644
--- /dev/null
+++ b/res/drawable/ic_baseline_departure_board_24.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#FFFFFF"
+ android:viewportHeight="24" android:viewportWidth="24"
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="@android:color/white" android:pathData="M16,1c-2.4,0 -4.52,1.21 -5.78,3.05 0.01,-0.01 0.01,-0.02 0.02,-0.03C9.84,4 9.42,4 9,4c-4.42,0 -8,0.5 -8,4v10c0,0.88 0.39,1.67 1,2.22L2,22c0,0.55 0.45,1 1,1h1c0.55,0 1,-0.45 1,-1v-1h8v1c0,0.55 0.45,1 1,1h1c0.55,0 1,-0.45 1,-1v-1.78c0.61,-0.55 1,-1.34 1,-2.22v-3.08c3.39,-0.49 6,-3.39 6,-6.92 0,-3.87 -3.13,-7 -7,-7zM4.5,19c-0.83,0 -1.5,-0.67 -1.5,-1.5S3.67,16 4.5,16s1.5,0.67 1.5,1.5S5.33,19 4.5,19zM3,13L3,8h6c0,1.96 0.81,3.73 2.11,5L3,13zM13.5,19c-0.83,0 -1.5,-0.67 -1.5,-1.5s0.67,-1.5 1.5,-1.5 1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5zM16,13c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM16.5,4L15,4v5l3.62,2.16 0.75,-1.23 -2.87,-1.68z"/>
+</vector>
diff --git a/res/drawable/ic_baseline_map_24.xml b/res/drawable/ic_baseline_map_24.xml
new file mode 100644
--- /dev/null
+++ b/res/drawable/ic_baseline_map_24.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#FFFFFF"
+ android:viewportHeight="24" android:viewportWidth="24"
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="@android:color/white" android:pathData="M20.5,3l-0.16,0.03L15,5.1 9,3 3.36,4.9c-0.21,0.07 -0.36,0.25 -0.36,0.48V20.5c0,0.28 0.22,0.5 0.5,0.5l0.16,-0.03L9,18.9l6,2.1 5.64,-1.9c0.21,-0.07 0.36,-0.25 0.36,-0.48V3.5c0,-0.28 -0.22,-0.5 -0.5,-0.5zM15,19l-6,-2.11V5l6,2.11V19z"/>
+</vector>
diff --git a/res/drawable/ic_favorite_heart.xml b/res/drawable/ic_favorite_heart.xml
new file mode 100644
--- /dev/null
+++ b/res/drawable/ic_favorite_heart.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#FFFFFF"
+ android:viewportHeight="24" android:viewportWidth="24"
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="@android:color/white" android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z"/>
+</vector>
diff --git a/res/drawable/ic_mars2020.xml b/res/drawable/ic_mars2020.xml
new file mode 100644
--- /dev/null
+++ b/res/drawable/ic_mars2020.xml
@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="40dp"
+ android:height="40dp"
+ android:viewportWidth="40"
+ android:viewportHeight="40">
+ <path
+ android:pathData="m31.6382,28.7711c0,0.8943 -0.7317,1.6247 -1.6247,1.6247h-2.876c-0.8943,0 -1.6247,-0.7304 -1.6247,-1.6247v-2.7009c0,-0.8943 -0.7317,-1.6261 -1.6247,-1.6261h-2.4612c-0.893,0 -1.6247,0.006 -1.6247,0.011 0,0.006 -0.7304,0.011 -1.6247,0.011h-2.6913c-0.8943,0 -1.6247,0.7317 -1.6247,1.6247v2.8332c0,0.8943 -0.7317,1.6247 -1.6247,1.6247L9.3608,30.5487c-0.8943,0 -1.6247,-0.7304 -1.6247,-1.6247v-2.8746c0,-0.8943 0.7304,-1.6261 1.6247,-1.6261h2.6913c0.8943,0 1.6247,-0.7304 1.6247,-1.6247v-2.8333c0,-0.893 0.0028,-1.6247 0.0055,-1.6247 0.0028,0 0.0055,-0.7317 0.0055,-1.6247v-2.8746c0,-0.8943 0.7304,-1.6261 1.6247,-1.6261h2.8746c0.8943,0 1.6247,0.7317 1.6247,1.6261v2.8539c0,0.893 0.7317,1.6247 1.6261,1.6247h2.6224c0.8943,0 1.6261,0.7304 1.6261,1.6247v2.7009c0,0.8943 0.7304,1.6261 1.6247,1.6261h2.7023c0.893,0 1.6247,0.7304 1.6247,1.6247zM25.8477,6.0183c0.3528,3.8489 0.6408,4.1355 4.4883,4.4896 -3.8475,0.3542 -4.1369,0.667 -4.4883,4.4896 -0.3514,-3.8392 -0.6422,-4.1355 -4.491,-4.4896 3.8489,-0.3541 4.1355,-0.6408 4.491,-4.4896m-6.1929,-4.4166c-10.2843,0 -18.62,8.3357 -18.62,18.6201 0,10.2829 8.3358,18.6201 18.62,18.6201 10.2829,0 18.6201,-8.3371 18.6201,-18.6201 0,-10.2843 -8.3371,-18.6201 -18.6201,-18.6201"
+ android:strokeWidth="0.352778"
+ android:fillColor="#dc001e"
+ android:strokeColor="#00000000"
+ android:fillType="nonZero"/>
+</vector>
diff --git a/res/drawable/ic_star_filled_white.xml b/res/drawable/ic_star_filled_white.xml
new file mode 100644
--- /dev/null
+++ b/res/drawable/ic_star_filled_white.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"/>
+</vector>
diff --git a/res/layout-v11/activity_main.xml b/res/layout-v11/activity_main.xml
deleted file mode 100644
--- a/res/layout-v11/activity_main.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:animateLayoutChanges="true"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="it.reyboz.bustorino.ActivityMain">
-
- <ImageButton
- android:id="@+id/QRButton"
- style="?android:attr/borderlessButtonStyle"
- android:layout_width="30dip"
- android:layout_height="30dip"
- android:layout_alignBottom="@+id/searchButton"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_marginLeft="16dp"
- android:layout_marginStart="16dp"
- android:background="@drawable/qrcode_button_custom"
- android:contentDescription="@string/qrcode"
- android:onClick="onQRButtonClick" />
-
- <EditText
- android:id="@+id/busStopSearchByIDEditText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="5dp"
- android:layout_marginLeft="5dip"
- android:layout_marginRight="5dip"
- android:layout_toEndOf="@+id/QRButton"
- android:layout_toLeftOf="@+id/searchButton"
- android:layout_toRightOf="@+id/QRButton"
- android:layout_toStartOf="@+id/searchButton"
- android:ems="10"
- android:hint="@string/insert_bus_stop_number"
- android:imeOptions="actionSearch"
- android:inputType="number"
- android:selectAllOnFocus="true"
- android:singleLine="true">
-
- <requestFocus />
- </EditText>
-
- <!--android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"-->
- <EditText
- android:id="@+id/busStopSearchByNameEditText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="5dp"
- android:layout_marginLeft="5dip"
- android:layout_marginRight="5dip"
- android:layout_toEndOf="@+id/QRButton"
- android:layout_toLeftOf="@+id/searchButton"
- android:layout_toRightOf="@+id/QRButton"
- android:layout_toStartOf="@+id/searchButton"
- android:ems="10"
- android:hint="@string/insert_bus_stop_name"
- android:imeOptions="actionSearch"
- android:singleLine="true"
- android:visibility="gone">
-
- <requestFocus />
- </EditText>
-
- <ImageButton
- android:id="@+id/searchButton"
- style="?android:attr/borderlessButtonStyle"
- android:layout_width="40dip"
- android:layout_height="40dip"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_alignTop="@+id/busStopSearchByIDEditText"
- android:layout_marginEnd="16dp"
- android:layout_marginRight="16dp"
- android:background="@drawable/search_button_custom"
- android:contentDescription="@string/search"
- android:onClick="onSearchClick" />
-
- <ProgressBar
- android:id="@+id/progressBar"
- style="?android:attr/progressBarStyleHorizontal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
- android:layout_alignParentStart="true"
- android:layout_below="@+id/searchButton"
- android:layout_marginEnd="16dp"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dp"
- android:layout_marginStart="16dip"
- android:indeterminateOnly="true"
- android:visibility="gone" />
-
- <TextView
- android:id="@+id/howDoesItWorkTextView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="10dp"
- android:layout_marginEnd="16dp"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dp"
- android:layout_marginStart="16dip"
- android:layout_toLeftOf="@+id/hideHintButton"
- android:layout_toStartOf="@+id/hideHintButton"
- android:text="@string/howDoesItWork"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/blue_500"
- android:visibility="gone" android:layout_below="@+id/searchButton"/>
-
- <Button
- android:id="@+id/hideHintButton"
- style="?android:attr/buttonStyleSmall"
- android:layout_width="85dip"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@+id/howDoesItWorkTextView"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_marginEnd="16dp"
- android:layout_marginRight="16dp"
- android:background="@drawable/route_background_bus"
- android:onClick="onHideHint"
- android:text="@string/hint_button"
- android:textColor="@color/grey_100"
- android:textSize="19sp"
- android:visibility="gone" />
-
- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
- android:id="@+id/listRefreshLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_below="@+id/howDoesItWorkTextView"
- android:animateLayoutChanges="true"
- android:visibility="gone">
-
- <FrameLayout
- android:layout_width="match_parent"
- android:id="@+id/resultFrame"
- android:layout_height="fill_parent"
- android:layout_alignParentLeft="true" android:layout_alignParentStart="true"/>
- </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/floatingActionButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_gravity="bottom|end"
- android:layout_margin="16dp"
- android:onClick="onToggleKeyboardLayout"
- android:src="@drawable/alphabetical"
- fabSize="normal"
- backgroundTint="@color/teal_500"
- rippleColor="@color/teal_300"
- elevation="15dp"
-
- />
-</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/activity_main.xml b/res/layout/activity_main.xml
--- a/res/layout/activity_main.xml
+++ b/res/layout/activity_main.xml
@@ -1,13 +1,33 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:paddingTop="@dimen/activity_vertical_margin"
android:id="@+id/mainActivityLayout"
+ android:orientation="vertical"
+
tools:context="it.reyboz.bustorino.ActivityMain">
+ <androidx.appcompat.widget.Toolbar
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="?attr/colorPrimary"
+ android:elevation="4dp"
+ android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
+ android:id="@+id/that_toolbar"
+ android:fitsSystemWindows="true"
+ app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
+
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/activity_vertical_margin">
+
<ImageButton
android:id="@+id/QRButton"
+ style="?android:attr/borderlessButtonStyle"
android:layout_width="30dip"
android:layout_height="30dip"
android:layout_alignBottom="@+id/searchButton"
@@ -17,7 +37,7 @@
android:layout_marginStart="16dp"
android:background="@drawable/qrcode_button_custom"
android:contentDescription="@string/qrcode"
- android:onClick="onQRButtonClick"/>
+ android:onClick="onQRButtonClick" />
<EditText
android:id="@+id/busStopSearchByIDEditText"
@@ -35,8 +55,9 @@
android:imeOptions="actionSearch"
android:inputType="number"
android:selectAllOnFocus="true"
- android:singleLine="true">
-
+ android:singleLine="true"
+ >
+
<requestFocus />
</EditText>
@@ -60,21 +81,21 @@
android:visibility="gone">
<requestFocus />
-
</EditText>
<ImageButton
android:id="@+id/searchButton"
+ style="?android:attr/borderlessButtonStyle"
android:layout_width="40dip"
android:layout_height="40dip"
- android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
android:layout_alignTop="@+id/busStopSearchByIDEditText"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:background="@drawable/search_button_custom"
android:contentDescription="@string/search"
- android:onClick="onSearchClick"/>
+ android:onClick="onSearchClick" />
<ProgressBar
android:id="@+id/progressBar"
@@ -93,13 +114,11 @@
android:indeterminateOnly="true"
android:visibility="gone" />
-
<TextView
android:id="@+id/howDoesItWorkTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_below="@id/progressBar"
- android:paddingTop="10dp"
+ android:layout_marginBottom="10dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dp"
@@ -109,7 +128,7 @@
android:text="@string/howDoesItWork"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/blue_500"
- android:visibility="gone"/>
+ android:visibility="gone" android:layout_below="@+id/searchButton"/>
<Button
android:id="@+id/hideHintButton"
@@ -127,21 +146,23 @@
android:textColor="@color/grey_100"
android:textSize="19sp"
android:visibility="gone" />
+
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
- android:id="@+id/listRefreshLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_below="@+id/howDoesItWorkTextView"
-
- >
- <FrameLayout
- android:layout_width="match_parent"
- android:id="@+id/resultFrame"
- android:layout_height="fill_parent"
- android:layout_alignParentLeft="true" android:layout_alignParentStart="true">
- </FrameLayout>
- </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+ android:id="@+id/listRefreshLayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_below="@+id/howDoesItWorkTextView"
+ android:animateLayoutChanges="true"
+ android:visibility="gone">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:id="@+id/resultFrame"
+ android:layout_height="fill_parent"
+ android:layout_alignParentLeft="true" android:layout_alignParentStart="true"/>
+ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
@@ -157,6 +178,7 @@
backgroundTint="@color/teal_500"
rippleColor="@color/teal_300"
elevation="15dp"
- />
-</RelativeLayout>
+ />
+ </RelativeLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/default_toobar.xml b/res/layout/default_toobar.xml
new file mode 100644
--- /dev/null
+++ b/res/layout/default_toobar.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/default_toolbar"
+ android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
+ android:background="?attr/colorPrimary"
+ android:fitsSystemWindows="true"
+ android:minHeight="?attr/actionBarSize"
+
+
+ android:elevation="4dp"
+ app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
+
+</androidx.appcompat.widget.Toolbar>
\ No newline at end of file
diff --git a/res/layout/fragment_main_screen.xml b/res/layout/fragment_main_screen.xml
new file mode 100644
--- /dev/null
+++ b/res/layout/fragment_main_screen.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context=".fragments.MainScreenFragment">
+
+ <ImageButton
+ android:id="@+id/QRButton"
+ style="?android:attr/borderlessButtonStyle"
+ android:layout_width="30dip"
+ android:layout_height="30dip"
+ android:layout_alignBottom="@+id/searchButton"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_marginLeft="16dp"
+ android:layout_marginStart="16dp"
+ android:background="@drawable/qrcode_button_custom"
+ android:contentDescription="@string/qrcode"
+ android:onClick="onQRButtonClick" />
+
+ <EditText
+ android:id="@+id/busStopSearchByIDEditText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="5dp"
+ android:layout_marginLeft="5dip"
+ android:layout_marginRight="5dip"
+ android:layout_toEndOf="@+id/QRButton"
+ android:layout_toLeftOf="@+id/searchButton"
+ android:layout_toRightOf="@+id/QRButton"
+ android:layout_toStartOf="@+id/searchButton"
+ android:ems="10"
+ android:hint="@string/insert_bus_stop_number"
+ android:imeOptions="actionSearch"
+ android:inputType="number"
+ android:selectAllOnFocus="true"
+ android:singleLine="true"
+ >
+
+ <requestFocus />
+ </EditText>
+
+ <!--android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"-->
+ <EditText
+ android:id="@+id/busStopSearchByNameEditText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="5dp"
+ android:layout_marginLeft="5dip"
+ android:layout_marginRight="5dip"
+ android:layout_toEndOf="@+id/QRButton"
+ android:layout_toLeftOf="@+id/searchButton"
+ android:layout_toRightOf="@+id/QRButton"
+ android:layout_toStartOf="@+id/searchButton"
+ android:ems="10"
+ android:hint="@string/insert_bus_stop_name"
+ android:imeOptions="actionSearch"
+ android:singleLine="true"
+ android:visibility="gone">
+
+ <requestFocus />
+ </EditText>
+
+ <ImageButton
+ android:id="@+id/searchButton"
+ style="?android:attr/borderlessButtonStyle"
+ android:layout_width="40dip"
+ android:layout_height="40dip"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_alignTop="@+id/busStopSearchByIDEditText"
+ android:layout_marginEnd="16dp"
+ android:layout_marginRight="16dp"
+ android:background="@drawable/search_button_custom"
+ android:contentDescription="@string/search"
+ android:onClick="onSearchClick" />
+
+ <ProgressBar
+ android:id="@+id/progressBar"
+ style="?android:attr/progressBarStyleHorizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/searchButton"
+ android:layout_marginEnd="16dp"
+ android:layout_marginLeft="16dip"
+ android:layout_marginRight="16dp"
+ android:layout_marginStart="16dip"
+ android:indeterminateOnly="true"
+ android:visibility="gone" />
+
+ <TextView
+ android:id="@+id/howDoesItWorkTextView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginLeft="16dip"
+ android:layout_marginRight="16dp"
+ android:layout_marginStart="16dip"
+ android:layout_toLeftOf="@+id/hideHintButton"
+ android:layout_toStartOf="@+id/hideHintButton"
+ android:text="@string/howDoesItWork"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="@color/blue_500"
+ android:visibility="gone" android:layout_below="@+id/searchButton"/>
+
+ <Button
+ android:id="@+id/hideHintButton"
+ style="?android:attr/buttonStyleSmall"
+ android:layout_width="85dip"
+ android:layout_height="wrap_content"
+ android:layout_alignBottom="@+id/howDoesItWorkTextView"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_marginEnd="16dp"
+ android:layout_marginRight="16dp"
+ android:background="@drawable/route_background_bus"
+ android:onClick="onHideHint"
+ android:text="@string/hint_button"
+ android:textColor="@color/grey_100"
+ android:textSize="19sp"
+ android:visibility="gone" />
+
+ <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+ android:id="@+id/listRefreshLayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_below="@+id/howDoesItWorkTextView"
+ android:animateLayoutChanges="true"
+ android:visibility="gone">
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:id="@+id/resultFrame"
+ android:layout_height="fill_parent"
+ android:layout_alignParentLeft="true" android:layout_alignParentStart="true"/>
+ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/floatingActionButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_gravity="bottom|end"
+ android:layout_margin="16dp"
+ android:onClick="onToggleKeyboardLayout"
+ android:src="@drawable/alphabetical"
+ fabSize="normal"
+ backgroundTint="@color/teal_500"
+ rippleColor="@color/teal_300"
+ elevation="15dp"
+
+ />
+</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/nav_header.xml b/res/layout/nav_header.xml
new file mode 100644
--- /dev/null
+++ b/res/layout/nav_header.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/grey_100"
+ android:padding="16dp"
+ android:theme="@style/ThemeOverlay.AppCompat.Dark"
+ android:gravity="bottom">
+
+ <ImageView
+ android:id="@+id/nav_img"
+ android:layout_width="match_parent"
+ android:layout_height="100dp"
+ android:minHeight="40dp"
+ app:srcCompat="@drawable/ic_mars2020" />
+
+ <TextView
+
+ android:layout_width="match_parent"
+
+ android:layout_height="wrap_content"
+
+ android:text="@string/app_name"
+
+ android:textAppearance="@style/ThemeOverlay.AppCompat.Light"
+ android:textSize="20sp"
+ />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/new_main_activity.xml b/res/layout/new_main_activity.xml
new file mode 100644
--- /dev/null
+++ b/res/layout/new_main_activity.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.drawerlayout.widget.DrawerLayout
+ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/drawer_layout"
+ android:layout_height="match_parent">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <!-- The ActionBar displayed at the top -->
+
+ <include
+ layout="@layout/default_toobar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+ <!-- The main content view where fragments are loaded -->
+
+ <FrameLayout
+ android:id="@+id/mainActContentFrame"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ </LinearLayout>
+
+ <com.google.android.material.navigation.NavigationView
+
+ android:id="@+id/nvView"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_gravity="start"
+ android:background="?attr/colorPrimaryDark"
+ android:theme="@style/ThemeOverlay.AppCompat.Dark"
+ app:headerLayout="@layout/nav_header"
+ app:insetForeground="@color/teal_200"
+ app:itemIconTint="@color/teal_200"
+ app:itemTextAppearance="?android:attr/textAppearanceMedium"
+ app:itemTextColor="@android:color/white"
+ android:fitsSystemWindows="true"
+ app:menu="@menu/drawer_main" />
+
+</androidx.drawerlayout.widget.DrawerLayout>
\ No newline at end of file
diff --git a/res/menu/drawer_main.xml b/res/menu/drawer_main.xml
new file mode 100644
--- /dev/null
+++ b/res/menu/drawer_main.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <group android:checkableBehavior="single">
+ <item
+ android:id="@+id/nav_arrivals"
+ android:icon="@drawable/ic_baseline_departure_board_24"
+ android:title="@string/nav_arrivals_text" />
+ <item
+ android:id="@+id/nav_map_item"
+ android:icon="@drawable/ic_baseline_map_24"
+ android:title="@string/nav_map_text" />
+ <item
+ android:id="@+id/nav_favorites_item"
+ android:icon="@drawable/ic_star_filled_white"
+ android:title="@string/nav_favorites_text" />
+ </group>
+
+</menu>
\ No newline at end of file
diff --git a/res/menu/main.xml b/res/menu/main.xml
--- a/res/menu/main.xml
+++ b/res/menu/main.xml
@@ -47,7 +47,12 @@
android:visible="true" />
<item
android:id="@+id/action_help"
- android:orderInCategory="4"
+ android:orderInCategory="8"
android:title="@string/action_help"
android:visible="true" />
+ <item
+ android:id="@+id/action_experiments"
+ android:title="@string/experiments"
+ android:orderInCategory="4"
+ />
</menu>
\ No newline at end of file
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -138,5 +138,11 @@
\n Il report potrebbe contenere informazioni sulla tua configurazione del telefono, o sullo stato al momento del crash.
\n Tutte le informazioni sensibili nel report verranno utilizzate solo per scopi diagnostici dagli sviluppatori, e non verranno mai pubblicate e/o divulgate.</string>
<string name="acra_email_message">L\'applicazione è crashata, e il crash report è stato messo negli allegati. Se vuoi, descrivi cosa stavi facendo prima del crash: \n</string>
+ <string name="nav_arrivals_text">Arrivi</string>
+ <string name="nav_map_text">Mappa</string>
+ <string name="nav_favorites_text">Preferiti</string>
+ <string name="drawer_open">Apri drawer</string>
+ <string name="drawer_close">Chiudi drawer</string>
+ <string name="experiments">Esperimenti</string>
</resources>
diff --git a/res/values-v19/styles.xml b/res/values-v19/styles.xml
new file mode 100644
--- /dev/null
+++ b/res/values-v19/styles.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="AppTheme.NoActionBar" parent="AppTheme">
+
+ <item name="android:windowTranslucentStatus">false</item>
+
+ <item name="windowActionBar">false</item>
+ <item name="windowNoTitle">true</item>
+ </style>
+</resources>
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2,6 +2,7 @@
<resources>
<string name="app_name" translatable="false">BusTO</string>
+ <string name="app_name_debug" translatable="false">BusTO Debug</string>
<string name="app_description">You\'re using the latest in technology when it comes to respecting your privacy.
</string>
<string name="search">Search</string>
@@ -143,10 +144,21 @@
-->
<string name="default_notification_channel" translatable="false">Default</string>
<string name="default_notification_channel_description">Default channel for notifications</string>
- <string name="too_many_permission_asks">Asked for %1$s permission too many times</string>
+ <string name="too_many_permission_asks">Asked for %1$s permission too many times</string>
<string name="permission_storage_maps_msg">Cannot use the map with the storage permission!</string>
<string name="storage_permission">storage</string>
- <string name="message_crash">The application has crashed. If you want, you can send the send the report via email to the developers by pressing \"OK\".
- \n Note that sensitive information may be contained in the report, and if so, it will be only used for diagnostic purposes by the developers, and never published.</string>
- <string name="acra_email_message">The application crashed and the crash report is in the attachments. Please describe what you were doing before the crash: \n</string>
+ <string name="message_crash">The application has crashed. If you want, you can send the send the report via email to
+ the developers by pressing \"OK\".
+ \n Note that sensitive information may be contained in the report, and if so, it will be only used for
+ diagnostic purposes by the developers, and never published.
+ </string>
+ <string name="acra_email_message">The application crashed and the crash report is in the attachments. Please
+ describe what you were doing before the crash: \n
+ </string>
+ <string name="nav_arrivals_text">Arrivals</string>
+ <string name="nav_map_text">Map</string>
+ <string name="nav_favorites_text">Favorites</string>
+ <string name="drawer_open">Open navigation drawer</string>
+ <string name="drawer_close">Close navigation drawer</string>
+ <string name="experiments">Experiments</string>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -24,7 +24,9 @@
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
</style>
- <style name="AppTheme.NoActionBar">
+
+ <style name="AppTheme.NoActionBar" parent="AppTheme">
+
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
diff --git a/src/com/google/transit/realtime/GtfsRealtime.java b/src/com/google/transit/realtime/GtfsRealtime.java
new file mode 100644
--- /dev/null
+++ b/src/com/google/transit/realtime/GtfsRealtime.java
@@ -0,0 +1,23720 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: gtfs-realtime.proto
+
+package com.google.transit.realtime;
+
+public final class GtfsRealtime {
+ private GtfsRealtime() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions(
+ (com.google.protobuf.ExtensionRegistryLite) registry);
+ }
+ public interface FeedMessageOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.FeedMessage)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<FeedMessage> {
+
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ * @return Whether the header field is set.
+ */
+ boolean hasHeader();
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ * @return The header.
+ */
+ com.google.transit.realtime.GtfsRealtime.FeedHeader getHeader();
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.FeedHeaderOrBuilder getHeaderOrBuilder();
+
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ java.util.List<com.google.transit.realtime.GtfsRealtime.FeedEntity>
+ getEntityList();
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.FeedEntity getEntity(int index);
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ int getEntityCount();
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ java.util.List<? extends com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder>
+ getEntityOrBuilderList();
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder getEntityOrBuilder(
+ int index);
+ }
+ /**
+ * <pre>
+ * The contents of a feed message.
+ * A feed is a continuous stream of feed messages. Each message in the stream is
+ * obtained as a response to an appropriate HTTP GET request.
+ * A realtime feed is always defined with relation to an existing GTFS feed.
+ * All the entity ids are resolved with respect to the GTFS feed.
+ * Note that "required" and "optional" as stated in this file refer to Protocol
+ * Buffer cardinality, not semantic cardinality. See reference.md at
+ * https://github.com/google/transit/tree/master/gtfs-realtime for field
+ * semantic cardinality.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.FeedMessage}
+ */
+ public static final class FeedMessage extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ FeedMessage> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.FeedMessage)
+ FeedMessageOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use FeedMessage.newBuilder() to construct.
+ private FeedMessage(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.FeedMessage, ?> builder) {
+ super(builder);
+ }
+ private FeedMessage() {
+ entity_ = java.util.Collections.emptyList();
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new FeedMessage();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private FeedMessage(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ subBuilder = header_.toBuilder();
+ }
+ header_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.FeedHeader.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(header_);
+ header_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 18: {
+ if (!((mutable_bitField0_ & 0x00000002) != 0)) {
+ entity_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.FeedEntity>();
+ mutable_bitField0_ |= 0x00000002;
+ }
+ entity_.add(
+ input.readMessage(com.google.transit.realtime.GtfsRealtime.FeedEntity.PARSER, extensionRegistry));
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000002) != 0)) {
+ entity_ = java.util.Collections.unmodifiableList(entity_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedMessage_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedMessage_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.FeedMessage.class, com.google.transit.realtime.GtfsRealtime.FeedMessage.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int HEADER_FIELD_NUMBER = 1;
+ private com.google.transit.realtime.GtfsRealtime.FeedHeader header_;
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ * @return Whether the header field is set.
+ */
+ @java.lang.Override
+ public boolean hasHeader() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ * @return The header.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedHeader getHeader() {
+ return header_ == null ? com.google.transit.realtime.GtfsRealtime.FeedHeader.getDefaultInstance() : header_;
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedHeaderOrBuilder getHeaderOrBuilder() {
+ return header_ == null ? com.google.transit.realtime.GtfsRealtime.FeedHeader.getDefaultInstance() : header_;
+ }
+
+ public static final int ENTITY_FIELD_NUMBER = 2;
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.FeedEntity> entity_;
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ @java.lang.Override
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.FeedEntity> getEntityList() {
+ return entity_;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ @java.lang.Override
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder>
+ getEntityOrBuilderList() {
+ return entity_;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ @java.lang.Override
+ public int getEntityCount() {
+ return entity_.size();
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedEntity getEntity(int index) {
+ return entity_.get(index);
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder getEntityOrBuilder(
+ int index) {
+ return entity_.get(index);
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasHeader()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getHeader().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ for (int i = 0; i < getEntityCount(); i++) {
+ if (!getEntity(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.FeedMessage>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ output.writeMessage(1, getHeader());
+ }
+ for (int i = 0; i < entity_.size(); i++) {
+ output.writeMessage(2, entity_.get(i));
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, getHeader());
+ }
+ for (int i = 0; i < entity_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, entity_.get(i));
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.FeedMessage)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.FeedMessage other = (com.google.transit.realtime.GtfsRealtime.FeedMessage) obj;
+
+ if (hasHeader() != other.hasHeader()) return false;
+ if (hasHeader()) {
+ if (!getHeader()
+ .equals(other.getHeader())) return false;
+ }
+ if (!getEntityList()
+ .equals(other.getEntityList())) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasHeader()) {
+ hash = (37 * hash) + HEADER_FIELD_NUMBER;
+ hash = (53 * hash) + getHeader().hashCode();
+ }
+ if (getEntityCount() > 0) {
+ hash = (37 * hash) + ENTITY_FIELD_NUMBER;
+ hash = (53 * hash) + getEntityList().hashCode();
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.FeedMessage prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * The contents of a feed message.
+ * A feed is a continuous stream of feed messages. Each message in the stream is
+ * obtained as a response to an appropriate HTTP GET request.
+ * A realtime feed is always defined with relation to an existing GTFS feed.
+ * All the entity ids are resolved with respect to the GTFS feed.
+ * Note that "required" and "optional" as stated in this file refer to Protocol
+ * Buffer cardinality, not semantic cardinality. See reference.md at
+ * https://github.com/google/transit/tree/master/gtfs-realtime for field
+ * semantic cardinality.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.FeedMessage}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.FeedMessage, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.FeedMessage)
+ com.google.transit.realtime.GtfsRealtime.FeedMessageOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedMessage_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedMessage_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.FeedMessage.class, com.google.transit.realtime.GtfsRealtime.FeedMessage.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.FeedMessage.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ getHeaderFieldBuilder();
+ getEntityFieldBuilder();
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ if (headerBuilder_ == null) {
+ header_ = null;
+ } else {
+ headerBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (entityBuilder_ == null) {
+ entity_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ } else {
+ entityBuilder_.clear();
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedMessage_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedMessage getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.FeedMessage.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedMessage build() {
+ com.google.transit.realtime.GtfsRealtime.FeedMessage result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedMessage buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.FeedMessage result = new com.google.transit.realtime.GtfsRealtime.FeedMessage(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ if (headerBuilder_ == null) {
+ result.header_ = header_;
+ } else {
+ result.header_ = headerBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000001;
+ }
+ if (entityBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) != 0)) {
+ entity_ = java.util.Collections.unmodifiableList(entity_);
+ bitField0_ = (bitField0_ & ~0x00000002);
+ }
+ result.entity_ = entity_;
+ } else {
+ result.entity_ = entityBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedMessage, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedMessage, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedMessage, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedMessage, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.FeedMessage) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.FeedMessage)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.FeedMessage other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.FeedMessage.getDefaultInstance()) return this;
+ if (other.hasHeader()) {
+ mergeHeader(other.getHeader());
+ }
+ if (entityBuilder_ == null) {
+ if (!other.entity_.isEmpty()) {
+ if (entity_.isEmpty()) {
+ entity_ = other.entity_;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ } else {
+ ensureEntityIsMutable();
+ entity_.addAll(other.entity_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.entity_.isEmpty()) {
+ if (entityBuilder_.isEmpty()) {
+ entityBuilder_.dispose();
+ entityBuilder_ = null;
+ entity_ = other.entity_;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ entityBuilder_ =
+ com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
+ getEntityFieldBuilder() : null;
+ } else {
+ entityBuilder_.addAllMessages(other.entity_);
+ }
+ }
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!hasHeader()) {
+ return false;
+ }
+ if (!getHeader().isInitialized()) {
+ return false;
+ }
+ for (int i = 0; i < getEntityCount(); i++) {
+ if (!getEntity(i).isInitialized()) {
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.FeedMessage parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.FeedMessage) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.transit.realtime.GtfsRealtime.FeedHeader header_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.FeedHeader, com.google.transit.realtime.GtfsRealtime.FeedHeader.Builder, com.google.transit.realtime.GtfsRealtime.FeedHeaderOrBuilder> headerBuilder_;
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ * @return Whether the header field is set.
+ */
+ public boolean hasHeader() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ * @return The header.
+ */
+ public com.google.transit.realtime.GtfsRealtime.FeedHeader getHeader() {
+ if (headerBuilder_ == null) {
+ return header_ == null ? com.google.transit.realtime.GtfsRealtime.FeedHeader.getDefaultInstance() : header_;
+ } else {
+ return headerBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ */
+ public Builder setHeader(com.google.transit.realtime.GtfsRealtime.FeedHeader value) {
+ if (headerBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ header_ = value;
+ onChanged();
+ } else {
+ headerBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ */
+ public Builder setHeader(
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.Builder builderForValue) {
+ if (headerBuilder_ == null) {
+ header_ = builderForValue.build();
+ onChanged();
+ } else {
+ headerBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ */
+ public Builder mergeHeader(com.google.transit.realtime.GtfsRealtime.FeedHeader value) {
+ if (headerBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) != 0) &&
+ header_ != null &&
+ header_ != com.google.transit.realtime.GtfsRealtime.FeedHeader.getDefaultInstance()) {
+ header_ =
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.newBuilder(header_).mergeFrom(value).buildPartial();
+ } else {
+ header_ = value;
+ }
+ onChanged();
+ } else {
+ headerBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ */
+ public Builder clearHeader() {
+ if (headerBuilder_ == null) {
+ header_ = null;
+ onChanged();
+ } else {
+ headerBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.FeedHeader.Builder getHeaderBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getHeaderFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.FeedHeaderOrBuilder getHeaderOrBuilder() {
+ if (headerBuilder_ != null) {
+ return headerBuilder_.getMessageOrBuilder();
+ } else {
+ return header_ == null ?
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.getDefaultInstance() : header_;
+ }
+ }
+ /**
+ * <pre>
+ * Metadata about this feed and feed message.
+ * </pre>
+ *
+ * <code>required .transit_realtime.FeedHeader header = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.FeedHeader, com.google.transit.realtime.GtfsRealtime.FeedHeader.Builder, com.google.transit.realtime.GtfsRealtime.FeedHeaderOrBuilder>
+ getHeaderFieldBuilder() {
+ if (headerBuilder_ == null) {
+ headerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.FeedHeader, com.google.transit.realtime.GtfsRealtime.FeedHeader.Builder, com.google.transit.realtime.GtfsRealtime.FeedHeaderOrBuilder>(
+ getHeader(),
+ getParentForChildren(),
+ isClean());
+ header_ = null;
+ }
+ return headerBuilder_;
+ }
+
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.FeedEntity> entity_ =
+ java.util.Collections.emptyList();
+ private void ensureEntityIsMutable() {
+ if (!((bitField0_ & 0x00000002) != 0)) {
+ entity_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.FeedEntity>(entity_);
+ bitField0_ |= 0x00000002;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.FeedEntity, com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder, com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder> entityBuilder_;
+
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.FeedEntity> getEntityList() {
+ if (entityBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(entity_);
+ } else {
+ return entityBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public int getEntityCount() {
+ if (entityBuilder_ == null) {
+ return entity_.size();
+ } else {
+ return entityBuilder_.getCount();
+ }
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.FeedEntity getEntity(int index) {
+ if (entityBuilder_ == null) {
+ return entity_.get(index);
+ } else {
+ return entityBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public Builder setEntity(
+ int index, com.google.transit.realtime.GtfsRealtime.FeedEntity value) {
+ if (entityBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureEntityIsMutable();
+ entity_.set(index, value);
+ onChanged();
+ } else {
+ entityBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public Builder setEntity(
+ int index, com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder builderForValue) {
+ if (entityBuilder_ == null) {
+ ensureEntityIsMutable();
+ entity_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ entityBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public Builder addEntity(com.google.transit.realtime.GtfsRealtime.FeedEntity value) {
+ if (entityBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureEntityIsMutable();
+ entity_.add(value);
+ onChanged();
+ } else {
+ entityBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public Builder addEntity(
+ int index, com.google.transit.realtime.GtfsRealtime.FeedEntity value) {
+ if (entityBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureEntityIsMutable();
+ entity_.add(index, value);
+ onChanged();
+ } else {
+ entityBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public Builder addEntity(
+ com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder builderForValue) {
+ if (entityBuilder_ == null) {
+ ensureEntityIsMutable();
+ entity_.add(builderForValue.build());
+ onChanged();
+ } else {
+ entityBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public Builder addEntity(
+ int index, com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder builderForValue) {
+ if (entityBuilder_ == null) {
+ ensureEntityIsMutable();
+ entity_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ entityBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public Builder addAllEntity(
+ java.lang.Iterable<? extends com.google.transit.realtime.GtfsRealtime.FeedEntity> values) {
+ if (entityBuilder_ == null) {
+ ensureEntityIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, entity_);
+ onChanged();
+ } else {
+ entityBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public Builder clearEntity() {
+ if (entityBuilder_ == null) {
+ entity_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ } else {
+ entityBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public Builder removeEntity(int index) {
+ if (entityBuilder_ == null) {
+ ensureEntityIsMutable();
+ entity_.remove(index);
+ onChanged();
+ } else {
+ entityBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder getEntityBuilder(
+ int index) {
+ return getEntityFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder getEntityOrBuilder(
+ int index) {
+ if (entityBuilder_ == null) {
+ return entity_.get(index); } else {
+ return entityBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder>
+ getEntityOrBuilderList() {
+ if (entityBuilder_ != null) {
+ return entityBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(entity_);
+ }
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder addEntityBuilder() {
+ return getEntityFieldBuilder().addBuilder(
+ com.google.transit.realtime.GtfsRealtime.FeedEntity.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder addEntityBuilder(
+ int index) {
+ return getEntityFieldBuilder().addBuilder(
+ index, com.google.transit.realtime.GtfsRealtime.FeedEntity.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * Contents of the feed.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.FeedEntity entity = 2;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder>
+ getEntityBuilderList() {
+ return getEntityFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.FeedEntity, com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder, com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder>
+ getEntityFieldBuilder() {
+ if (entityBuilder_ == null) {
+ entityBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.FeedEntity, com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder, com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder>(
+ entity_,
+ ((bitField0_ & 0x00000002) != 0),
+ getParentForChildren(),
+ isClean());
+ entity_ = null;
+ }
+ return entityBuilder_;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.FeedMessage)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.FeedMessage)
+ private static final com.google.transit.realtime.GtfsRealtime.FeedMessage DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.FeedMessage();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.FeedMessage getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<FeedMessage>
+ PARSER = new com.google.protobuf.AbstractParser<FeedMessage>() {
+ @java.lang.Override
+ public FeedMessage parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new FeedMessage(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<FeedMessage> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<FeedMessage> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedMessage getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface FeedHeaderOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.FeedHeader)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<FeedHeader> {
+
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return Whether the gtfsRealtimeVersion field is set.
+ */
+ boolean hasGtfsRealtimeVersion();
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return The gtfsRealtimeVersion.
+ */
+ java.lang.String getGtfsRealtimeVersion();
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return The bytes for gtfsRealtimeVersion.
+ */
+ com.google.protobuf.ByteString
+ getGtfsRealtimeVersionBytes();
+
+ /**
+ * <code>optional .transit_realtime.FeedHeader.Incrementality incrementality = 2 [default = FULL_DATASET];</code>
+ * @return Whether the incrementality field is set.
+ */
+ boolean hasIncrementality();
+ /**
+ * <code>optional .transit_realtime.FeedHeader.Incrementality incrementality = 2 [default = FULL_DATASET];</code>
+ * @return The incrementality.
+ */
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality getIncrementality();
+
+ /**
+ * <pre>
+ * This timestamp identifies the moment when the content of this feed has been
+ * created (in server time). In POSIX time (i.e., number of seconds since
+ * January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 3;</code>
+ * @return Whether the timestamp field is set.
+ */
+ boolean hasTimestamp();
+ /**
+ * <pre>
+ * This timestamp identifies the moment when the content of this feed has been
+ * created (in server time). In POSIX time (i.e., number of seconds since
+ * January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 3;</code>
+ * @return The timestamp.
+ */
+ long getTimestamp();
+ }
+ /**
+ * <pre>
+ * Metadata about a feed, included in feed messages.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.FeedHeader}
+ */
+ public static final class FeedHeader extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ FeedHeader> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.FeedHeader)
+ FeedHeaderOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use FeedHeader.newBuilder() to construct.
+ private FeedHeader(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.FeedHeader, ?> builder) {
+ super(builder);
+ }
+ private FeedHeader() {
+ gtfsRealtimeVersion_ = "";
+ incrementality_ = 0;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new FeedHeader();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private FeedHeader(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000001;
+ gtfsRealtimeVersion_ = bs;
+ break;
+ }
+ case 16: {
+ int rawValue = input.readEnum();
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality value = com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(2, rawValue);
+ } else {
+ bitField0_ |= 0x00000002;
+ incrementality_ = rawValue;
+ }
+ break;
+ }
+ case 24: {
+ bitField0_ |= 0x00000004;
+ timestamp_ = input.readUInt64();
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedHeader_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedHeader_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.class, com.google.transit.realtime.GtfsRealtime.FeedHeader.Builder.class);
+ }
+
+ /**
+ * <pre>
+ * Determines whether the current fetch is incremental. Currently,
+ * DIFFERENTIAL mode is unsupported and behavior is unspecified for feeds
+ * that use this mode. There are discussions on the GTFS Realtime mailing
+ * list around fully specifying the behavior of DIFFERENTIAL mode and the
+ * documentation will be updated when those discussions are finalized.
+ * </pre>
+ *
+ * Protobuf enum {@code transit_realtime.FeedHeader.Incrementality}
+ */
+ public enum Incrementality
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>FULL_DATASET = 0;</code>
+ */
+ FULL_DATASET(0),
+ /**
+ * <code>DIFFERENTIAL = 1;</code>
+ */
+ DIFFERENTIAL(1),
+ ;
+
+ /**
+ * <code>FULL_DATASET = 0;</code>
+ */
+ public static final int FULL_DATASET_VALUE = 0;
+ /**
+ * <code>DIFFERENTIAL = 1;</code>
+ */
+ public static final int DIFFERENTIAL_VALUE = 1;
+
+
+ public final int getNumber() {
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Incrementality valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Incrementality forNumber(int value) {
+ switch (value) {
+ case 0: return FULL_DATASET;
+ case 1: return DIFFERENTIAL;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Incrementality>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ Incrementality> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Incrementality>() {
+ public Incrementality findValueByNumber(int number) {
+ return Incrementality.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.FeedHeader.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Incrementality[] VALUES = values();
+
+ public static Incrementality valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private Incrementality(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:transit_realtime.FeedHeader.Incrementality)
+ }
+
+ private int bitField0_;
+ public static final int GTFS_REALTIME_VERSION_FIELD_NUMBER = 1;
+ private volatile java.lang.Object gtfsRealtimeVersion_;
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return Whether the gtfsRealtimeVersion field is set.
+ */
+ @java.lang.Override
+ public boolean hasGtfsRealtimeVersion() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return The gtfsRealtimeVersion.
+ */
+ @java.lang.Override
+ public java.lang.String getGtfsRealtimeVersion() {
+ java.lang.Object ref = gtfsRealtimeVersion_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ gtfsRealtimeVersion_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return The bytes for gtfsRealtimeVersion.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getGtfsRealtimeVersionBytes() {
+ java.lang.Object ref = gtfsRealtimeVersion_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ gtfsRealtimeVersion_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int INCREMENTALITY_FIELD_NUMBER = 2;
+ private int incrementality_;
+ /**
+ * <code>optional .transit_realtime.FeedHeader.Incrementality incrementality = 2 [default = FULL_DATASET];</code>
+ * @return Whether the incrementality field is set.
+ */
+ @java.lang.Override public boolean hasIncrementality() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.FeedHeader.Incrementality incrementality = 2 [default = FULL_DATASET];</code>
+ * @return The incrementality.
+ */
+ @java.lang.Override public com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality getIncrementality() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality result = com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality.valueOf(incrementality_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality.FULL_DATASET : result;
+ }
+
+ public static final int TIMESTAMP_FIELD_NUMBER = 3;
+ private long timestamp_;
+ /**
+ * <pre>
+ * This timestamp identifies the moment when the content of this feed has been
+ * created (in server time). In POSIX time (i.e., number of seconds since
+ * January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 3;</code>
+ * @return Whether the timestamp field is set.
+ */
+ @java.lang.Override
+ public boolean hasTimestamp() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * This timestamp identifies the moment when the content of this feed has been
+ * created (in server time). In POSIX time (i.e., number of seconds since
+ * January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 3;</code>
+ * @return The timestamp.
+ */
+ @java.lang.Override
+ public long getTimestamp() {
+ return timestamp_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasGtfsRealtimeVersion()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.FeedHeader>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gtfsRealtimeVersion_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ output.writeEnum(2, incrementality_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeUInt64(3, timestamp_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gtfsRealtimeVersion_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(2, incrementality_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(3, timestamp_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.FeedHeader)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.FeedHeader other = (com.google.transit.realtime.GtfsRealtime.FeedHeader) obj;
+
+ if (hasGtfsRealtimeVersion() != other.hasGtfsRealtimeVersion()) return false;
+ if (hasGtfsRealtimeVersion()) {
+ if (!getGtfsRealtimeVersion()
+ .equals(other.getGtfsRealtimeVersion())) return false;
+ }
+ if (hasIncrementality() != other.hasIncrementality()) return false;
+ if (hasIncrementality()) {
+ if (incrementality_ != other.incrementality_) return false;
+ }
+ if (hasTimestamp() != other.hasTimestamp()) return false;
+ if (hasTimestamp()) {
+ if (getTimestamp()
+ != other.getTimestamp()) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasGtfsRealtimeVersion()) {
+ hash = (37 * hash) + GTFS_REALTIME_VERSION_FIELD_NUMBER;
+ hash = (53 * hash) + getGtfsRealtimeVersion().hashCode();
+ }
+ if (hasIncrementality()) {
+ hash = (37 * hash) + INCREMENTALITY_FIELD_NUMBER;
+ hash = (53 * hash) + incrementality_;
+ }
+ if (hasTimestamp()) {
+ hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getTimestamp());
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.FeedHeader prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * Metadata about a feed, included in feed messages.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.FeedHeader}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.FeedHeader, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.FeedHeader)
+ com.google.transit.realtime.GtfsRealtime.FeedHeaderOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedHeader_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedHeader_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.class, com.google.transit.realtime.GtfsRealtime.FeedHeader.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.FeedHeader.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ gtfsRealtimeVersion_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ incrementality_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ timestamp_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedHeader_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedHeader getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.FeedHeader.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedHeader build() {
+ com.google.transit.realtime.GtfsRealtime.FeedHeader result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedHeader buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.FeedHeader result = new com.google.transit.realtime.GtfsRealtime.FeedHeader(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.gtfsRealtimeVersion_ = gtfsRealtimeVersion_;
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.incrementality_ = incrementality_;
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.timestamp_ = timestamp_;
+ to_bitField0_ |= 0x00000004;
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedHeader, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedHeader, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedHeader, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedHeader, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.FeedHeader) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.FeedHeader)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.FeedHeader other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.FeedHeader.getDefaultInstance()) return this;
+ if (other.hasGtfsRealtimeVersion()) {
+ bitField0_ |= 0x00000001;
+ gtfsRealtimeVersion_ = other.gtfsRealtimeVersion_;
+ onChanged();
+ }
+ if (other.hasIncrementality()) {
+ setIncrementality(other.getIncrementality());
+ }
+ if (other.hasTimestamp()) {
+ setTimestamp(other.getTimestamp());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!hasGtfsRealtimeVersion()) {
+ return false;
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.FeedHeader parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.FeedHeader) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private java.lang.Object gtfsRealtimeVersion_ = "";
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return Whether the gtfsRealtimeVersion field is set.
+ */
+ public boolean hasGtfsRealtimeVersion() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return The gtfsRealtimeVersion.
+ */
+ public java.lang.String getGtfsRealtimeVersion() {
+ java.lang.Object ref = gtfsRealtimeVersion_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ gtfsRealtimeVersion_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return The bytes for gtfsRealtimeVersion.
+ */
+ public com.google.protobuf.ByteString
+ getGtfsRealtimeVersionBytes() {
+ java.lang.Object ref = gtfsRealtimeVersion_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ gtfsRealtimeVersion_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @param value The gtfsRealtimeVersion to set.
+ * @return This builder for chaining.
+ */
+ public Builder setGtfsRealtimeVersion(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ gtfsRealtimeVersion_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearGtfsRealtimeVersion() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ gtfsRealtimeVersion_ = getDefaultInstance().getGtfsRealtimeVersion();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Version of the feed specification.
+ * The current version is 2.0.
+ * </pre>
+ *
+ * <code>required string gtfs_realtime_version = 1;</code>
+ * @param value The bytes for gtfsRealtimeVersion to set.
+ * @return This builder for chaining.
+ */
+ public Builder setGtfsRealtimeVersionBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ gtfsRealtimeVersion_ = value;
+ onChanged();
+ return this;
+ }
+
+ private int incrementality_ = 0;
+ /**
+ * <code>optional .transit_realtime.FeedHeader.Incrementality incrementality = 2 [default = FULL_DATASET];</code>
+ * @return Whether the incrementality field is set.
+ */
+ @java.lang.Override public boolean hasIncrementality() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.FeedHeader.Incrementality incrementality = 2 [default = FULL_DATASET];</code>
+ * @return The incrementality.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality getIncrementality() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality result = com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality.valueOf(incrementality_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality.FULL_DATASET : result;
+ }
+ /**
+ * <code>optional .transit_realtime.FeedHeader.Incrementality incrementality = 2 [default = FULL_DATASET];</code>
+ * @param value The incrementality to set.
+ * @return This builder for chaining.
+ */
+ public Builder setIncrementality(com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ incrementality_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.FeedHeader.Incrementality incrementality = 2 [default = FULL_DATASET];</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearIncrementality() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ incrementality_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private long timestamp_ ;
+ /**
+ * <pre>
+ * This timestamp identifies the moment when the content of this feed has been
+ * created (in server time). In POSIX time (i.e., number of seconds since
+ * January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 3;</code>
+ * @return Whether the timestamp field is set.
+ */
+ @java.lang.Override
+ public boolean hasTimestamp() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * This timestamp identifies the moment when the content of this feed has been
+ * created (in server time). In POSIX time (i.e., number of seconds since
+ * January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 3;</code>
+ * @return The timestamp.
+ */
+ @java.lang.Override
+ public long getTimestamp() {
+ return timestamp_;
+ }
+ /**
+ * <pre>
+ * This timestamp identifies the moment when the content of this feed has been
+ * created (in server time). In POSIX time (i.e., number of seconds since
+ * January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 3;</code>
+ * @param value The timestamp to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTimestamp(long value) {
+ bitField0_ |= 0x00000004;
+ timestamp_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * This timestamp identifies the moment when the content of this feed has been
+ * created (in server time). In POSIX time (i.e., number of seconds since
+ * January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 3;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearTimestamp() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ timestamp_ = 0L;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.FeedHeader)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.FeedHeader)
+ private static final com.google.transit.realtime.GtfsRealtime.FeedHeader DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.FeedHeader();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.FeedHeader getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<FeedHeader>
+ PARSER = new com.google.protobuf.AbstractParser<FeedHeader>() {
+ @java.lang.Override
+ public FeedHeader parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new FeedHeader(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<FeedHeader> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<FeedHeader> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedHeader getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface FeedEntityOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.FeedEntity)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<FeedEntity> {
+
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return Whether the id field is set.
+ */
+ boolean hasId();
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return The id.
+ */
+ java.lang.String getId();
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return The bytes for id.
+ */
+ com.google.protobuf.ByteString
+ getIdBytes();
+
+ /**
+ * <pre>
+ * Whether this entity is to be deleted. Relevant only for incremental
+ * fetches.
+ * </pre>
+ *
+ * <code>optional bool is_deleted = 2 [default = false];</code>
+ * @return Whether the isDeleted field is set.
+ */
+ boolean hasIsDeleted();
+ /**
+ * <pre>
+ * Whether this entity is to be deleted. Relevant only for incremental
+ * fetches.
+ * </pre>
+ *
+ * <code>optional bool is_deleted = 2 [default = false];</code>
+ * @return The isDeleted.
+ */
+ boolean getIsDeleted();
+
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ * @return Whether the tripUpdate field is set.
+ */
+ boolean hasTripUpdate();
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ * @return The tripUpdate.
+ */
+ com.google.transit.realtime.GtfsRealtime.TripUpdate getTripUpdate();
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TripUpdateOrBuilder getTripUpdateOrBuilder();
+
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ * @return Whether the vehicle field is set.
+ */
+ boolean hasVehicle();
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ * @return The vehicle.
+ */
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition getVehicle();
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.VehiclePositionOrBuilder getVehicleOrBuilder();
+
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ * @return Whether the alert field is set.
+ */
+ boolean hasAlert();
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ * @return The alert.
+ */
+ com.google.transit.realtime.GtfsRealtime.Alert getAlert();
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.AlertOrBuilder getAlertOrBuilder();
+ }
+ /**
+ * <pre>
+ * A definition (or update) of an entity in the transit feed.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.FeedEntity}
+ */
+ public static final class FeedEntity extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ FeedEntity> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.FeedEntity)
+ FeedEntityOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use FeedEntity.newBuilder() to construct.
+ private FeedEntity(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.FeedEntity, ?> builder) {
+ super(builder);
+ }
+ private FeedEntity() {
+ id_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new FeedEntity();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private FeedEntity(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000001;
+ id_ = bs;
+ break;
+ }
+ case 16: {
+ bitField0_ |= 0x00000002;
+ isDeleted_ = input.readBool();
+ break;
+ }
+ case 26: {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) != 0)) {
+ subBuilder = tripUpdate_.toBuilder();
+ }
+ tripUpdate_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.TripUpdate.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(tripUpdate_);
+ tripUpdate_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) != 0)) {
+ subBuilder = vehicle_.toBuilder();
+ }
+ vehicle_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.VehiclePosition.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(vehicle_);
+ vehicle_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 42: {
+ com.google.transit.realtime.GtfsRealtime.Alert.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) != 0)) {
+ subBuilder = alert_.toBuilder();
+ }
+ alert_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.Alert.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(alert_);
+ alert_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedEntity_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedEntity_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.FeedEntity.class, com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int ID_FIELD_NUMBER = 1;
+ private volatile java.lang.Object id_;
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return Whether the id field is set.
+ */
+ @java.lang.Override
+ public boolean hasId() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return The id.
+ */
+ @java.lang.Override
+ public java.lang.String getId() {
+ java.lang.Object ref = id_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ id_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return The bytes for id.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getIdBytes() {
+ java.lang.Object ref = id_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ id_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int IS_DELETED_FIELD_NUMBER = 2;
+ private boolean isDeleted_;
+ /**
+ * <pre>
+ * Whether this entity is to be deleted. Relevant only for incremental
+ * fetches.
+ * </pre>
+ *
+ * <code>optional bool is_deleted = 2 [default = false];</code>
+ * @return Whether the isDeleted field is set.
+ */
+ @java.lang.Override
+ public boolean hasIsDeleted() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Whether this entity is to be deleted. Relevant only for incremental
+ * fetches.
+ * </pre>
+ *
+ * <code>optional bool is_deleted = 2 [default = false];</code>
+ * @return The isDeleted.
+ */
+ @java.lang.Override
+ public boolean getIsDeleted() {
+ return isDeleted_;
+ }
+
+ public static final int TRIP_UPDATE_FIELD_NUMBER = 3;
+ private com.google.transit.realtime.GtfsRealtime.TripUpdate tripUpdate_;
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ * @return Whether the tripUpdate field is set.
+ */
+ @java.lang.Override
+ public boolean hasTripUpdate() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ * @return The tripUpdate.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate getTripUpdate() {
+ return tripUpdate_ == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.getDefaultInstance() : tripUpdate_;
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdateOrBuilder getTripUpdateOrBuilder() {
+ return tripUpdate_ == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.getDefaultInstance() : tripUpdate_;
+ }
+
+ public static final int VEHICLE_FIELD_NUMBER = 4;
+ private com.google.transit.realtime.GtfsRealtime.VehiclePosition vehicle_;
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ * @return Whether the vehicle field is set.
+ */
+ @java.lang.Override
+ public boolean hasVehicle() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ * @return The vehicle.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition getVehicle() {
+ return vehicle_ == null ? com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDefaultInstance() : vehicle_;
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehiclePositionOrBuilder getVehicleOrBuilder() {
+ return vehicle_ == null ? com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDefaultInstance() : vehicle_;
+ }
+
+ public static final int ALERT_FIELD_NUMBER = 5;
+ private com.google.transit.realtime.GtfsRealtime.Alert alert_;
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ * @return Whether the alert field is set.
+ */
+ @java.lang.Override
+ public boolean hasAlert() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ * @return The alert.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Alert getAlert() {
+ return alert_ == null ? com.google.transit.realtime.GtfsRealtime.Alert.getDefaultInstance() : alert_;
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.AlertOrBuilder getAlertOrBuilder() {
+ return alert_ == null ? com.google.transit.realtime.GtfsRealtime.Alert.getDefaultInstance() : alert_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasId()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (hasTripUpdate()) {
+ if (!getTripUpdate().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasVehicle()) {
+ if (!getVehicle().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasAlert()) {
+ if (!getAlert().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.FeedEntity>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ output.writeBool(2, isDeleted_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeMessage(3, getTripUpdate());
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ output.writeMessage(4, getVehicle());
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ output.writeMessage(5, getAlert());
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBoolSize(2, isDeleted_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getTripUpdate());
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, getVehicle());
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(5, getAlert());
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.FeedEntity)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.FeedEntity other = (com.google.transit.realtime.GtfsRealtime.FeedEntity) obj;
+
+ if (hasId() != other.hasId()) return false;
+ if (hasId()) {
+ if (!getId()
+ .equals(other.getId())) return false;
+ }
+ if (hasIsDeleted() != other.hasIsDeleted()) return false;
+ if (hasIsDeleted()) {
+ if (getIsDeleted()
+ != other.getIsDeleted()) return false;
+ }
+ if (hasTripUpdate() != other.hasTripUpdate()) return false;
+ if (hasTripUpdate()) {
+ if (!getTripUpdate()
+ .equals(other.getTripUpdate())) return false;
+ }
+ if (hasVehicle() != other.hasVehicle()) return false;
+ if (hasVehicle()) {
+ if (!getVehicle()
+ .equals(other.getVehicle())) return false;
+ }
+ if (hasAlert() != other.hasAlert()) return false;
+ if (hasAlert()) {
+ if (!getAlert()
+ .equals(other.getAlert())) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasId()) {
+ hash = (37 * hash) + ID_FIELD_NUMBER;
+ hash = (53 * hash) + getId().hashCode();
+ }
+ if (hasIsDeleted()) {
+ hash = (37 * hash) + IS_DELETED_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
+ getIsDeleted());
+ }
+ if (hasTripUpdate()) {
+ hash = (37 * hash) + TRIP_UPDATE_FIELD_NUMBER;
+ hash = (53 * hash) + getTripUpdate().hashCode();
+ }
+ if (hasVehicle()) {
+ hash = (37 * hash) + VEHICLE_FIELD_NUMBER;
+ hash = (53 * hash) + getVehicle().hashCode();
+ }
+ if (hasAlert()) {
+ hash = (37 * hash) + ALERT_FIELD_NUMBER;
+ hash = (53 * hash) + getAlert().hashCode();
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.FeedEntity prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * A definition (or update) of an entity in the transit feed.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.FeedEntity}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.FeedEntity, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.FeedEntity)
+ com.google.transit.realtime.GtfsRealtime.FeedEntityOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedEntity_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedEntity_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.FeedEntity.class, com.google.transit.realtime.GtfsRealtime.FeedEntity.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.FeedEntity.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ getTripUpdateFieldBuilder();
+ getVehicleFieldBuilder();
+ getAlertFieldBuilder();
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ id_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ isDeleted_ = false;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (tripUpdateBuilder_ == null) {
+ tripUpdate_ = null;
+ } else {
+ tripUpdateBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ if (vehicleBuilder_ == null) {
+ vehicle_ = null;
+ } else {
+ vehicleBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ if (alertBuilder_ == null) {
+ alert_ = null;
+ } else {
+ alertBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000010);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_FeedEntity_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedEntity getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.FeedEntity.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedEntity build() {
+ com.google.transit.realtime.GtfsRealtime.FeedEntity result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedEntity buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.FeedEntity result = new com.google.transit.realtime.GtfsRealtime.FeedEntity(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.id_ = id_;
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ result.isDeleted_ = isDeleted_;
+ to_bitField0_ |= 0x00000002;
+ }
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ if (tripUpdateBuilder_ == null) {
+ result.tripUpdate_ = tripUpdate_;
+ } else {
+ result.tripUpdate_ = tripUpdateBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000004;
+ }
+ if (((from_bitField0_ & 0x00000008) != 0)) {
+ if (vehicleBuilder_ == null) {
+ result.vehicle_ = vehicle_;
+ } else {
+ result.vehicle_ = vehicleBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000008;
+ }
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ if (alertBuilder_ == null) {
+ result.alert_ = alert_;
+ } else {
+ result.alert_ = alertBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000010;
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedEntity, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedEntity, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedEntity, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.FeedEntity, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.FeedEntity) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.FeedEntity)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.FeedEntity other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.FeedEntity.getDefaultInstance()) return this;
+ if (other.hasId()) {
+ bitField0_ |= 0x00000001;
+ id_ = other.id_;
+ onChanged();
+ }
+ if (other.hasIsDeleted()) {
+ setIsDeleted(other.getIsDeleted());
+ }
+ if (other.hasTripUpdate()) {
+ mergeTripUpdate(other.getTripUpdate());
+ }
+ if (other.hasVehicle()) {
+ mergeVehicle(other.getVehicle());
+ }
+ if (other.hasAlert()) {
+ mergeAlert(other.getAlert());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!hasId()) {
+ return false;
+ }
+ if (hasTripUpdate()) {
+ if (!getTripUpdate().isInitialized()) {
+ return false;
+ }
+ }
+ if (hasVehicle()) {
+ if (!getVehicle().isInitialized()) {
+ return false;
+ }
+ }
+ if (hasAlert()) {
+ if (!getAlert().isInitialized()) {
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.FeedEntity parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.FeedEntity) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private java.lang.Object id_ = "";
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return Whether the id field is set.
+ */
+ public boolean hasId() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return The id.
+ */
+ public java.lang.String getId() {
+ java.lang.Object ref = id_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ id_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return The bytes for id.
+ */
+ public com.google.protobuf.ByteString
+ getIdBytes() {
+ java.lang.Object ref = id_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ id_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @param value The id to set.
+ * @return This builder for chaining.
+ */
+ public Builder setId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ id_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearId() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ id_ = getDefaultInstance().getId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The ids are used only to provide incrementality support. The id should be
+ * unique within a FeedMessage. Consequent FeedMessages may contain
+ * FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+ * FeedEntity with some id will replace the old FeedEntity with the same id
+ * (or delete it - see is_deleted below).
+ * The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+ * feed must be specified by explicit selectors (see EntitySelector below for
+ * more info).
+ * </pre>
+ *
+ * <code>required string id = 1;</code>
+ * @param value The bytes for id to set.
+ * @return This builder for chaining.
+ */
+ public Builder setIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ id_ = value;
+ onChanged();
+ return this;
+ }
+
+ private boolean isDeleted_ ;
+ /**
+ * <pre>
+ * Whether this entity is to be deleted. Relevant only for incremental
+ * fetches.
+ * </pre>
+ *
+ * <code>optional bool is_deleted = 2 [default = false];</code>
+ * @return Whether the isDeleted field is set.
+ */
+ @java.lang.Override
+ public boolean hasIsDeleted() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Whether this entity is to be deleted. Relevant only for incremental
+ * fetches.
+ * </pre>
+ *
+ * <code>optional bool is_deleted = 2 [default = false];</code>
+ * @return The isDeleted.
+ */
+ @java.lang.Override
+ public boolean getIsDeleted() {
+ return isDeleted_;
+ }
+ /**
+ * <pre>
+ * Whether this entity is to be deleted. Relevant only for incremental
+ * fetches.
+ * </pre>
+ *
+ * <code>optional bool is_deleted = 2 [default = false];</code>
+ * @param value The isDeleted to set.
+ * @return This builder for chaining.
+ */
+ public Builder setIsDeleted(boolean value) {
+ bitField0_ |= 0x00000002;
+ isDeleted_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Whether this entity is to be deleted. Relevant only for incremental
+ * fetches.
+ * </pre>
+ *
+ * <code>optional bool is_deleted = 2 [default = false];</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearIsDeleted() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ isDeleted_ = false;
+ onChanged();
+ return this;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.TripUpdate tripUpdate_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate, com.google.transit.realtime.GtfsRealtime.TripUpdate.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdateOrBuilder> tripUpdateBuilder_;
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ * @return Whether the tripUpdate field is set.
+ */
+ public boolean hasTripUpdate() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ * @return The tripUpdate.
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate getTripUpdate() {
+ if (tripUpdateBuilder_ == null) {
+ return tripUpdate_ == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.getDefaultInstance() : tripUpdate_;
+ } else {
+ return tripUpdateBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ */
+ public Builder setTripUpdate(com.google.transit.realtime.GtfsRealtime.TripUpdate value) {
+ if (tripUpdateBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ tripUpdate_ = value;
+ onChanged();
+ } else {
+ tripUpdateBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ */
+ public Builder setTripUpdate(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.Builder builderForValue) {
+ if (tripUpdateBuilder_ == null) {
+ tripUpdate_ = builderForValue.build();
+ onChanged();
+ } else {
+ tripUpdateBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ */
+ public Builder mergeTripUpdate(com.google.transit.realtime.GtfsRealtime.TripUpdate value) {
+ if (tripUpdateBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) != 0) &&
+ tripUpdate_ != null &&
+ tripUpdate_ != com.google.transit.realtime.GtfsRealtime.TripUpdate.getDefaultInstance()) {
+ tripUpdate_ =
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.newBuilder(tripUpdate_).mergeFrom(value).buildPartial();
+ } else {
+ tripUpdate_ = value;
+ }
+ onChanged();
+ } else {
+ tripUpdateBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ */
+ public Builder clearTripUpdate() {
+ if (tripUpdateBuilder_ == null) {
+ tripUpdate_ = null;
+ onChanged();
+ } else {
+ tripUpdateBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.Builder getTripUpdateBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getTripUpdateFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdateOrBuilder getTripUpdateOrBuilder() {
+ if (tripUpdateBuilder_ != null) {
+ return tripUpdateBuilder_.getMessageOrBuilder();
+ } else {
+ return tripUpdate_ == null ?
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.getDefaultInstance() : tripUpdate_;
+ }
+ }
+ /**
+ * <pre>
+ * Data about the entity itself. Exactly one of the following fields must be
+ * present (unless the entity is being deleted).
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripUpdate trip_update = 3;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate, com.google.transit.realtime.GtfsRealtime.TripUpdate.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdateOrBuilder>
+ getTripUpdateFieldBuilder() {
+ if (tripUpdateBuilder_ == null) {
+ tripUpdateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate, com.google.transit.realtime.GtfsRealtime.TripUpdate.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdateOrBuilder>(
+ getTripUpdate(),
+ getParentForChildren(),
+ isClean());
+ tripUpdate_ = null;
+ }
+ return tripUpdateBuilder_;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.VehiclePosition vehicle_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition, com.google.transit.realtime.GtfsRealtime.VehiclePosition.Builder, com.google.transit.realtime.GtfsRealtime.VehiclePositionOrBuilder> vehicleBuilder_;
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ * @return Whether the vehicle field is set.
+ */
+ public boolean hasVehicle() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ * @return The vehicle.
+ */
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition getVehicle() {
+ if (vehicleBuilder_ == null) {
+ return vehicle_ == null ? com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDefaultInstance() : vehicle_;
+ } else {
+ return vehicleBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ */
+ public Builder setVehicle(com.google.transit.realtime.GtfsRealtime.VehiclePosition value) {
+ if (vehicleBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ vehicle_ = value;
+ onChanged();
+ } else {
+ vehicleBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ */
+ public Builder setVehicle(
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.Builder builderForValue) {
+ if (vehicleBuilder_ == null) {
+ vehicle_ = builderForValue.build();
+ onChanged();
+ } else {
+ vehicleBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ */
+ public Builder mergeVehicle(com.google.transit.realtime.GtfsRealtime.VehiclePosition value) {
+ if (vehicleBuilder_ == null) {
+ if (((bitField0_ & 0x00000008) != 0) &&
+ vehicle_ != null &&
+ vehicle_ != com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDefaultInstance()) {
+ vehicle_ =
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.newBuilder(vehicle_).mergeFrom(value).buildPartial();
+ } else {
+ vehicle_ = value;
+ }
+ onChanged();
+ } else {
+ vehicleBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ */
+ public Builder clearVehicle() {
+ if (vehicleBuilder_ == null) {
+ vehicle_ = null;
+ onChanged();
+ } else {
+ vehicleBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition.Builder getVehicleBuilder() {
+ bitField0_ |= 0x00000008;
+ onChanged();
+ return getVehicleFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.VehiclePositionOrBuilder getVehicleOrBuilder() {
+ if (vehicleBuilder_ != null) {
+ return vehicleBuilder_.getMessageOrBuilder();
+ } else {
+ return vehicle_ == null ?
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDefaultInstance() : vehicle_;
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition vehicle = 4;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition, com.google.transit.realtime.GtfsRealtime.VehiclePosition.Builder, com.google.transit.realtime.GtfsRealtime.VehiclePositionOrBuilder>
+ getVehicleFieldBuilder() {
+ if (vehicleBuilder_ == null) {
+ vehicleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition, com.google.transit.realtime.GtfsRealtime.VehiclePosition.Builder, com.google.transit.realtime.GtfsRealtime.VehiclePositionOrBuilder>(
+ getVehicle(),
+ getParentForChildren(),
+ isClean());
+ vehicle_ = null;
+ }
+ return vehicleBuilder_;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.Alert alert_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.Alert, com.google.transit.realtime.GtfsRealtime.Alert.Builder, com.google.transit.realtime.GtfsRealtime.AlertOrBuilder> alertBuilder_;
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ * @return Whether the alert field is set.
+ */
+ public boolean hasAlert() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ * @return The alert.
+ */
+ public com.google.transit.realtime.GtfsRealtime.Alert getAlert() {
+ if (alertBuilder_ == null) {
+ return alert_ == null ? com.google.transit.realtime.GtfsRealtime.Alert.getDefaultInstance() : alert_;
+ } else {
+ return alertBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ */
+ public Builder setAlert(com.google.transit.realtime.GtfsRealtime.Alert value) {
+ if (alertBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ alert_ = value;
+ onChanged();
+ } else {
+ alertBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ */
+ public Builder setAlert(
+ com.google.transit.realtime.GtfsRealtime.Alert.Builder builderForValue) {
+ if (alertBuilder_ == null) {
+ alert_ = builderForValue.build();
+ onChanged();
+ } else {
+ alertBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ */
+ public Builder mergeAlert(com.google.transit.realtime.GtfsRealtime.Alert value) {
+ if (alertBuilder_ == null) {
+ if (((bitField0_ & 0x00000010) != 0) &&
+ alert_ != null &&
+ alert_ != com.google.transit.realtime.GtfsRealtime.Alert.getDefaultInstance()) {
+ alert_ =
+ com.google.transit.realtime.GtfsRealtime.Alert.newBuilder(alert_).mergeFrom(value).buildPartial();
+ } else {
+ alert_ = value;
+ }
+ onChanged();
+ } else {
+ alertBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ */
+ public Builder clearAlert() {
+ if (alertBuilder_ == null) {
+ alert_ = null;
+ onChanged();
+ } else {
+ alertBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000010);
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.Alert.Builder getAlertBuilder() {
+ bitField0_ |= 0x00000010;
+ onChanged();
+ return getAlertFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.AlertOrBuilder getAlertOrBuilder() {
+ if (alertBuilder_ != null) {
+ return alertBuilder_.getMessageOrBuilder();
+ } else {
+ return alert_ == null ?
+ com.google.transit.realtime.GtfsRealtime.Alert.getDefaultInstance() : alert_;
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.Alert alert = 5;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.Alert, com.google.transit.realtime.GtfsRealtime.Alert.Builder, com.google.transit.realtime.GtfsRealtime.AlertOrBuilder>
+ getAlertFieldBuilder() {
+ if (alertBuilder_ == null) {
+ alertBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.Alert, com.google.transit.realtime.GtfsRealtime.Alert.Builder, com.google.transit.realtime.GtfsRealtime.AlertOrBuilder>(
+ getAlert(),
+ getParentForChildren(),
+ isClean());
+ alert_ = null;
+ }
+ return alertBuilder_;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.FeedEntity)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.FeedEntity)
+ private static final com.google.transit.realtime.GtfsRealtime.FeedEntity DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.FeedEntity();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.FeedEntity getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<FeedEntity>
+ PARSER = new com.google.protobuf.AbstractParser<FeedEntity>() {
+ @java.lang.Override
+ public FeedEntity parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new FeedEntity(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<FeedEntity> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<FeedEntity> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.FeedEntity getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface TripUpdateOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.TripUpdate)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<TripUpdate> {
+
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return Whether the trip field is set.
+ */
+ boolean hasTrip();
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return The trip.
+ */
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor getTrip();
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder getTripOrBuilder();
+
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ * @return Whether the vehicle field is set.
+ */
+ boolean hasVehicle();
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ * @return The vehicle.
+ */
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor getVehicle();
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder getVehicleOrBuilder();
+
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ java.util.List<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate>
+ getStopTimeUpdateList();
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate getStopTimeUpdate(int index);
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ int getStopTimeUpdateCount();
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ java.util.List<? extends com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder>
+ getStopTimeUpdateOrBuilderList();
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder getStopTimeUpdateOrBuilder(
+ int index);
+
+ /**
+ * <pre>
+ * Moment at which the vehicle's real-time progress was measured. In POSIX
+ * time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 4;</code>
+ * @return Whether the timestamp field is set.
+ */
+ boolean hasTimestamp();
+ /**
+ * <pre>
+ * Moment at which the vehicle's real-time progress was measured. In POSIX
+ * time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 4;</code>
+ * @return The timestamp.
+ */
+ long getTimestamp();
+
+ /**
+ * <pre>
+ * The current schedule deviation for the trip. Delay should only be
+ * specified when the prediction is given relative to some existing schedule
+ * in GTFS.
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * Delay information in StopTimeUpdates take precedent of trip-level delay
+ * information, such that trip-level delay is only propagated until the next
+ * stop along the trip with a StopTimeUpdate delay value specified.
+ * Feed providers are strongly encouraged to provide a TripUpdate.timestamp
+ * value indicating when the delay value was last updated, in order to
+ * evaluate the freshness of the data.
+ * NOTE: This field is still experimental, and subject to change. It may be
+ * formally adopted in the future.
+ * </pre>
+ *
+ * <code>optional int32 delay = 5;</code>
+ * @return Whether the delay field is set.
+ */
+ boolean hasDelay();
+ /**
+ * <pre>
+ * The current schedule deviation for the trip. Delay should only be
+ * specified when the prediction is given relative to some existing schedule
+ * in GTFS.
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * Delay information in StopTimeUpdates take precedent of trip-level delay
+ * information, such that trip-level delay is only propagated until the next
+ * stop along the trip with a StopTimeUpdate delay value specified.
+ * Feed providers are strongly encouraged to provide a TripUpdate.timestamp
+ * value indicating when the delay value was last updated, in order to
+ * evaluate the freshness of the data.
+ * NOTE: This field is still experimental, and subject to change. It may be
+ * formally adopted in the future.
+ * </pre>
+ *
+ * <code>optional int32 delay = 5;</code>
+ * @return The delay.
+ */
+ int getDelay();
+ }
+ /**
+ * <pre>
+ * Realtime update of the progress of a vehicle along a trip.
+ * Depending on the value of ScheduleRelationship, a TripUpdate can specify:
+ * - A trip that proceeds along the schedule.
+ * - A trip that proceeds along a route but has no fixed schedule.
+ * - A trip that have been added or removed with regard to schedule.
+ * The updates can be for future, predicted arrival/departure events, or for
+ * past events that already occurred.
+ * Normally, updates should get more precise and more certain (see
+ * uncertainty below) as the events gets closer to current time.
+ * Even if that is not possible, the information for past events should be
+ * precise and certain. In particular, if an update points to time in the past
+ * but its update's uncertainty is not 0, the client should conclude that the
+ * update is a (wrong) prediction and that the trip has not completed yet.
+ * Note that the update can describe a trip that is already completed.
+ * To this end, it is enough to provide an update for the last stop of the trip.
+ * If the time of that is in the past, the client will conclude from that that
+ * the whole trip is in the past (it is possible, although inconsequential, to
+ * also provide updates for preceding stops).
+ * This option is most relevant for a trip that has completed ahead of schedule,
+ * but according to the schedule, the trip is still proceeding at the current
+ * time. Removing the updates for this trip could make the client assume
+ * that the trip is still proceeding.
+ * Note that the feed provider is allowed, but not required, to purge past
+ * updates - this is one case where this would be practically useful.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TripUpdate}
+ */
+ public static final class TripUpdate extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ TripUpdate> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.TripUpdate)
+ TripUpdateOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use TripUpdate.newBuilder() to construct.
+ private TripUpdate(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.TripUpdate, ?> builder) {
+ super(builder);
+ }
+ private TripUpdate() {
+ stopTimeUpdate_ = java.util.Collections.emptyList();
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new TripUpdate();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private TripUpdate(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ subBuilder = trip_.toBuilder();
+ }
+ trip_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.TripDescriptor.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(trip_);
+ trip_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 18: {
+ if (!((mutable_bitField0_ & 0x00000004) != 0)) {
+ stopTimeUpdate_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate>();
+ mutable_bitField0_ |= 0x00000004;
+ }
+ stopTimeUpdate_.add(
+ input.readMessage(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.PARSER, extensionRegistry));
+ break;
+ }
+ case 26: {
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) != 0)) {
+ subBuilder = vehicle_.toBuilder();
+ }
+ vehicle_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(vehicle_);
+ vehicle_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 32: {
+ bitField0_ |= 0x00000004;
+ timestamp_ = input.readUInt64();
+ break;
+ }
+ case 40: {
+ bitField0_ |= 0x00000008;
+ delay_ = input.readInt32();
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000004) != 0)) {
+ stopTimeUpdate_ = java.util.Collections.unmodifiableList(stopTimeUpdate_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.class, com.google.transit.realtime.GtfsRealtime.TripUpdate.Builder.class);
+ }
+
+ public interface StopTimeEventOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.TripUpdate.StopTimeEvent)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<StopTimeEvent> {
+
+ /**
+ * <pre>
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * </pre>
+ *
+ * <code>optional int32 delay = 1;</code>
+ * @return Whether the delay field is set.
+ */
+ boolean hasDelay();
+ /**
+ * <pre>
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * </pre>
+ *
+ * <code>optional int32 delay = 1;</code>
+ * @return The delay.
+ */
+ int getDelay();
+
+ /**
+ * <pre>
+ * Event as absolute time.
+ * In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
+ * UTC).
+ * </pre>
+ *
+ * <code>optional int64 time = 2;</code>
+ * @return Whether the time field is set.
+ */
+ boolean hasTime();
+ /**
+ * <pre>
+ * Event as absolute time.
+ * In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
+ * UTC).
+ * </pre>
+ *
+ * <code>optional int64 time = 2;</code>
+ * @return The time.
+ */
+ long getTime();
+
+ /**
+ * <pre>
+ * If uncertainty is omitted, it is interpreted as unknown.
+ * If the prediction is unknown or too uncertain, the delay (or time) field
+ * should be empty. In such case, the uncertainty field is ignored.
+ * To specify a completely certain prediction, set its uncertainty to 0.
+ * </pre>
+ *
+ * <code>optional int32 uncertainty = 3;</code>
+ * @return Whether the uncertainty field is set.
+ */
+ boolean hasUncertainty();
+ /**
+ * <pre>
+ * If uncertainty is omitted, it is interpreted as unknown.
+ * If the prediction is unknown or too uncertain, the delay (or time) field
+ * should be empty. In such case, the uncertainty field is ignored.
+ * To specify a completely certain prediction, set its uncertainty to 0.
+ * </pre>
+ *
+ * <code>optional int32 uncertainty = 3;</code>
+ * @return The uncertainty.
+ */
+ int getUncertainty();
+ }
+ /**
+ * <pre>
+ * Timing information for a single predicted event (either arrival or
+ * departure).
+ * Timing consists of delay and/or estimated time, and uncertainty.
+ * - delay should be used when the prediction is given relative to some
+ * existing schedule in GTFS.
+ * - time should be given whether there is a predicted schedule or not. If
+ * both time and delay are specified, time will take precedence
+ * (although normally, time, if given for a scheduled trip, should be
+ * equal to scheduled time in GTFS + delay).
+ * Uncertainty applies equally to both time and delay.
+ * The uncertainty roughly specifies the expected error in true delay (but
+ * note, we don't yet define its precise statistical meaning). It's possible
+ * for the uncertainty to be 0, for example for trains that are driven under
+ * computer timing control.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TripUpdate.StopTimeEvent}
+ */
+ public static final class StopTimeEvent extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ StopTimeEvent> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.TripUpdate.StopTimeEvent)
+ StopTimeEventOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use StopTimeEvent.newBuilder() to construct.
+ private StopTimeEvent(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, ?> builder) {
+ super(builder);
+ }
+ private StopTimeEvent() {
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new StopTimeEvent();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private StopTimeEvent(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 8: {
+ bitField0_ |= 0x00000001;
+ delay_ = input.readInt32();
+ break;
+ }
+ case 16: {
+ bitField0_ |= 0x00000002;
+ time_ = input.readInt64();
+ break;
+ }
+ case 24: {
+ bitField0_ |= 0x00000004;
+ uncertainty_ = input.readInt32();
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeEvent_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeEvent_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.class, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int DELAY_FIELD_NUMBER = 1;
+ private int delay_;
+ /**
+ * <pre>
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * </pre>
+ *
+ * <code>optional int32 delay = 1;</code>
+ * @return Whether the delay field is set.
+ */
+ @java.lang.Override
+ public boolean hasDelay() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * </pre>
+ *
+ * <code>optional int32 delay = 1;</code>
+ * @return The delay.
+ */
+ @java.lang.Override
+ public int getDelay() {
+ return delay_;
+ }
+
+ public static final int TIME_FIELD_NUMBER = 2;
+ private long time_;
+ /**
+ * <pre>
+ * Event as absolute time.
+ * In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
+ * UTC).
+ * </pre>
+ *
+ * <code>optional int64 time = 2;</code>
+ * @return Whether the time field is set.
+ */
+ @java.lang.Override
+ public boolean hasTime() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Event as absolute time.
+ * In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
+ * UTC).
+ * </pre>
+ *
+ * <code>optional int64 time = 2;</code>
+ * @return The time.
+ */
+ @java.lang.Override
+ public long getTime() {
+ return time_;
+ }
+
+ public static final int UNCERTAINTY_FIELD_NUMBER = 3;
+ private int uncertainty_;
+ /**
+ * <pre>
+ * If uncertainty is omitted, it is interpreted as unknown.
+ * If the prediction is unknown or too uncertain, the delay (or time) field
+ * should be empty. In such case, the uncertainty field is ignored.
+ * To specify a completely certain prediction, set its uncertainty to 0.
+ * </pre>
+ *
+ * <code>optional int32 uncertainty = 3;</code>
+ * @return Whether the uncertainty field is set.
+ */
+ @java.lang.Override
+ public boolean hasUncertainty() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * If uncertainty is omitted, it is interpreted as unknown.
+ * If the prediction is unknown or too uncertain, the delay (or time) field
+ * should be empty. In such case, the uncertainty field is ignored.
+ * To specify a completely certain prediction, set its uncertainty to 0.
+ * </pre>
+ *
+ * <code>optional int32 uncertainty = 3;</code>
+ * @return The uncertainty.
+ */
+ @java.lang.Override
+ public int getUncertainty() {
+ return uncertainty_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ output.writeInt32(1, delay_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ output.writeInt64(2, time_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeInt32(3, uncertainty_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(1, delay_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(2, time_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(3, uncertainty_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent other = (com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent) obj;
+
+ if (hasDelay() != other.hasDelay()) return false;
+ if (hasDelay()) {
+ if (getDelay()
+ != other.getDelay()) return false;
+ }
+ if (hasTime() != other.hasTime()) return false;
+ if (hasTime()) {
+ if (getTime()
+ != other.getTime()) return false;
+ }
+ if (hasUncertainty() != other.hasUncertainty()) return false;
+ if (hasUncertainty()) {
+ if (getUncertainty()
+ != other.getUncertainty()) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasDelay()) {
+ hash = (37 * hash) + DELAY_FIELD_NUMBER;
+ hash = (53 * hash) + getDelay();
+ }
+ if (hasTime()) {
+ hash = (37 * hash) + TIME_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getTime());
+ }
+ if (hasUncertainty()) {
+ hash = (37 * hash) + UNCERTAINTY_FIELD_NUMBER;
+ hash = (53 * hash) + getUncertainty();
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * Timing information for a single predicted event (either arrival or
+ * departure).
+ * Timing consists of delay and/or estimated time, and uncertainty.
+ * - delay should be used when the prediction is given relative to some
+ * existing schedule in GTFS.
+ * - time should be given whether there is a predicted schedule or not. If
+ * both time and delay are specified, time will take precedence
+ * (although normally, time, if given for a scheduled trip, should be
+ * equal to scheduled time in GTFS + delay).
+ * Uncertainty applies equally to both time and delay.
+ * The uncertainty roughly specifies the expected error in true delay (but
+ * note, we don't yet define its precise statistical meaning). It's possible
+ * for the uncertainty to be 0, for example for trains that are driven under
+ * computer timing control.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TripUpdate.StopTimeEvent}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.TripUpdate.StopTimeEvent)
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeEvent_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeEvent_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.class, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ delay_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ time_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ uncertainty_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeEvent_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent build() {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent result = new com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ result.delay_ = delay_;
+ to_bitField0_ |= 0x00000001;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ result.time_ = time_;
+ to_bitField0_ |= 0x00000002;
+ }
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.uncertainty_ = uncertainty_;
+ to_bitField0_ |= 0x00000004;
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance()) return this;
+ if (other.hasDelay()) {
+ setDelay(other.getDelay());
+ }
+ if (other.hasTime()) {
+ setTime(other.getTime());
+ }
+ if (other.hasUncertainty()) {
+ setUncertainty(other.getUncertainty());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private int delay_ ;
+ /**
+ * <pre>
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * </pre>
+ *
+ * <code>optional int32 delay = 1;</code>
+ * @return Whether the delay field is set.
+ */
+ @java.lang.Override
+ public boolean hasDelay() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * </pre>
+ *
+ * <code>optional int32 delay = 1;</code>
+ * @return The delay.
+ */
+ @java.lang.Override
+ public int getDelay() {
+ return delay_;
+ }
+ /**
+ * <pre>
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * </pre>
+ *
+ * <code>optional int32 delay = 1;</code>
+ * @param value The delay to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDelay(int value) {
+ bitField0_ |= 0x00000001;
+ delay_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * </pre>
+ *
+ * <code>optional int32 delay = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearDelay() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ delay_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private long time_ ;
+ /**
+ * <pre>
+ * Event as absolute time.
+ * In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
+ * UTC).
+ * </pre>
+ *
+ * <code>optional int64 time = 2;</code>
+ * @return Whether the time field is set.
+ */
+ @java.lang.Override
+ public boolean hasTime() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Event as absolute time.
+ * In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
+ * UTC).
+ * </pre>
+ *
+ * <code>optional int64 time = 2;</code>
+ * @return The time.
+ */
+ @java.lang.Override
+ public long getTime() {
+ return time_;
+ }
+ /**
+ * <pre>
+ * Event as absolute time.
+ * In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
+ * UTC).
+ * </pre>
+ *
+ * <code>optional int64 time = 2;</code>
+ * @param value The time to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTime(long value) {
+ bitField0_ |= 0x00000002;
+ time_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Event as absolute time.
+ * In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
+ * UTC).
+ * </pre>
+ *
+ * <code>optional int64 time = 2;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearTime() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ time_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private int uncertainty_ ;
+ /**
+ * <pre>
+ * If uncertainty is omitted, it is interpreted as unknown.
+ * If the prediction is unknown or too uncertain, the delay (or time) field
+ * should be empty. In such case, the uncertainty field is ignored.
+ * To specify a completely certain prediction, set its uncertainty to 0.
+ * </pre>
+ *
+ * <code>optional int32 uncertainty = 3;</code>
+ * @return Whether the uncertainty field is set.
+ */
+ @java.lang.Override
+ public boolean hasUncertainty() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * If uncertainty is omitted, it is interpreted as unknown.
+ * If the prediction is unknown or too uncertain, the delay (or time) field
+ * should be empty. In such case, the uncertainty field is ignored.
+ * To specify a completely certain prediction, set its uncertainty to 0.
+ * </pre>
+ *
+ * <code>optional int32 uncertainty = 3;</code>
+ * @return The uncertainty.
+ */
+ @java.lang.Override
+ public int getUncertainty() {
+ return uncertainty_;
+ }
+ /**
+ * <pre>
+ * If uncertainty is omitted, it is interpreted as unknown.
+ * If the prediction is unknown or too uncertain, the delay (or time) field
+ * should be empty. In such case, the uncertainty field is ignored.
+ * To specify a completely certain prediction, set its uncertainty to 0.
+ * </pre>
+ *
+ * <code>optional int32 uncertainty = 3;</code>
+ * @param value The uncertainty to set.
+ * @return This builder for chaining.
+ */
+ public Builder setUncertainty(int value) {
+ bitField0_ |= 0x00000004;
+ uncertainty_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * If uncertainty is omitted, it is interpreted as unknown.
+ * If the prediction is unknown or too uncertain, the delay (or time) field
+ * should be empty. In such case, the uncertainty field is ignored.
+ * To specify a completely certain prediction, set its uncertainty to 0.
+ * </pre>
+ *
+ * <code>optional int32 uncertainty = 3;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearUncertainty() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ uncertainty_ = 0;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.TripUpdate.StopTimeEvent)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.TripUpdate.StopTimeEvent)
+ private static final com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<StopTimeEvent>
+ PARSER = new com.google.protobuf.AbstractParser<StopTimeEvent>() {
+ @java.lang.Override
+ public StopTimeEvent parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new StopTimeEvent(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<StopTimeEvent> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<StopTimeEvent> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface StopTimeUpdateOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.TripUpdate.StopTimeUpdate)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<StopTimeUpdate> {
+
+ /**
+ * <pre>
+ * Must be the same as in stop_times.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional uint32 stop_sequence = 1;</code>
+ * @return Whether the stopSequence field is set.
+ */
+ boolean hasStopSequence();
+ /**
+ * <pre>
+ * Must be the same as in stop_times.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional uint32 stop_sequence = 1;</code>
+ * @return The stopSequence.
+ */
+ int getStopSequence();
+
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return Whether the stopId field is set.
+ */
+ boolean hasStopId();
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return The stopId.
+ */
+ java.lang.String getStopId();
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return The bytes for stopId.
+ */
+ com.google.protobuf.ByteString
+ getStopIdBytes();
+
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ * @return Whether the arrival field is set.
+ */
+ boolean hasArrival();
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ * @return The arrival.
+ */
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent getArrival();
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder getArrivalOrBuilder();
+
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ * @return Whether the departure field is set.
+ */
+ boolean hasDeparture();
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ * @return The departure.
+ */
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent getDeparture();
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder getDepartureOrBuilder();
+
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship schedule_relationship = 5 [default = SCHEDULED];</code>
+ * @return Whether the scheduleRelationship field is set.
+ */
+ boolean hasScheduleRelationship();
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship schedule_relationship = 5 [default = SCHEDULED];</code>
+ * @return The scheduleRelationship.
+ */
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship getScheduleRelationship();
+ }
+ /**
+ * <pre>
+ * Realtime update for arrival and/or departure events for a given stop on a
+ * trip. Updates can be supplied for both past and future events.
+ * The producer is allowed, although not required, to drop past events.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TripUpdate.StopTimeUpdate}
+ */
+ public static final class StopTimeUpdate extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ StopTimeUpdate> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.TripUpdate.StopTimeUpdate)
+ StopTimeUpdateOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use StopTimeUpdate.newBuilder() to construct.
+ private StopTimeUpdate(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate, ?> builder) {
+ super(builder);
+ }
+ private StopTimeUpdate() {
+ stopId_ = "";
+ scheduleRelationship_ = 0;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new StopTimeUpdate();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private StopTimeUpdate(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 8: {
+ bitField0_ |= 0x00000001;
+ stopSequence_ = input.readUInt32();
+ break;
+ }
+ case 18: {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) != 0)) {
+ subBuilder = arrival_.toBuilder();
+ }
+ arrival_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(arrival_);
+ arrival_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 26: {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) != 0)) {
+ subBuilder = departure_.toBuilder();
+ }
+ departure_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(departure_);
+ departure_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 34: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000002;
+ stopId_ = bs;
+ break;
+ }
+ case 40: {
+ int rawValue = input.readEnum();
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship value = com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(5, rawValue);
+ } else {
+ bitField0_ |= 0x00000010;
+ scheduleRelationship_ = rawValue;
+ }
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeUpdate_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeUpdate_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.class, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder.class);
+ }
+
+ /**
+ * <pre>
+ * The relation between this StopTime and the static schedule.
+ * </pre>
+ *
+ * Protobuf enum {@code transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship}
+ */
+ public enum ScheduleRelationship
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <pre>
+ * The vehicle is proceeding in accordance with its static schedule of
+ * stops, although not necessarily according to the times of the schedule.
+ * At least one of arrival and departure must be provided. If the schedule
+ * for this stop contains both arrival and departure times then so must
+ * this update.
+ * </pre>
+ *
+ * <code>SCHEDULED = 0;</code>
+ */
+ SCHEDULED(0),
+ /**
+ * <pre>
+ * The stop is skipped, i.e., the vehicle will not stop at this stop.
+ * Arrival and departure are optional.
+ * </pre>
+ *
+ * <code>SKIPPED = 1;</code>
+ */
+ SKIPPED(1),
+ /**
+ * <pre>
+ * No data is given for this stop. The main intention for this value is to
+ * give the predictions only for part of a trip, i.e., if the last update
+ * for a trip has a NO_DATA specifier, then StopTimes for the rest of the
+ * stops in the trip are considered to be unspecified as well.
+ * Neither arrival nor departure should be supplied.
+ * </pre>
+ *
+ * <code>NO_DATA = 2;</code>
+ */
+ NO_DATA(2),
+ ;
+
+ /**
+ * <pre>
+ * The vehicle is proceeding in accordance with its static schedule of
+ * stops, although not necessarily according to the times of the schedule.
+ * At least one of arrival and departure must be provided. If the schedule
+ * for this stop contains both arrival and departure times then so must
+ * this update.
+ * </pre>
+ *
+ * <code>SCHEDULED = 0;</code>
+ */
+ public static final int SCHEDULED_VALUE = 0;
+ /**
+ * <pre>
+ * The stop is skipped, i.e., the vehicle will not stop at this stop.
+ * Arrival and departure are optional.
+ * </pre>
+ *
+ * <code>SKIPPED = 1;</code>
+ */
+ public static final int SKIPPED_VALUE = 1;
+ /**
+ * <pre>
+ * No data is given for this stop. The main intention for this value is to
+ * give the predictions only for part of a trip, i.e., if the last update
+ * for a trip has a NO_DATA specifier, then StopTimes for the rest of the
+ * stops in the trip are considered to be unspecified as well.
+ * Neither arrival nor departure should be supplied.
+ * </pre>
+ *
+ * <code>NO_DATA = 2;</code>
+ */
+ public static final int NO_DATA_VALUE = 2;
+
+
+ public final int getNumber() {
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static ScheduleRelationship valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static ScheduleRelationship forNumber(int value) {
+ switch (value) {
+ case 0: return SCHEDULED;
+ case 1: return SKIPPED;
+ case 2: return NO_DATA;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<ScheduleRelationship>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ ScheduleRelationship> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<ScheduleRelationship>() {
+ public ScheduleRelationship findValueByNumber(int number) {
+ return ScheduleRelationship.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final ScheduleRelationship[] VALUES = values();
+
+ public static ScheduleRelationship valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private ScheduleRelationship(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship)
+ }
+
+ private int bitField0_;
+ public static final int STOP_SEQUENCE_FIELD_NUMBER = 1;
+ private int stopSequence_;
+ /**
+ * <pre>
+ * Must be the same as in stop_times.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional uint32 stop_sequence = 1;</code>
+ * @return Whether the stopSequence field is set.
+ */
+ @java.lang.Override
+ public boolean hasStopSequence() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Must be the same as in stop_times.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional uint32 stop_sequence = 1;</code>
+ * @return The stopSequence.
+ */
+ @java.lang.Override
+ public int getStopSequence() {
+ return stopSequence_;
+ }
+
+ public static final int STOP_ID_FIELD_NUMBER = 4;
+ private volatile java.lang.Object stopId_;
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return Whether the stopId field is set.
+ */
+ @java.lang.Override
+ public boolean hasStopId() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return The stopId.
+ */
+ @java.lang.Override
+ public java.lang.String getStopId() {
+ java.lang.Object ref = stopId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ stopId_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return The bytes for stopId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getStopIdBytes() {
+ java.lang.Object ref = stopId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ stopId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int ARRIVAL_FIELD_NUMBER = 2;
+ private com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent arrival_;
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ * @return Whether the arrival field is set.
+ */
+ @java.lang.Override
+ public boolean hasArrival() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ * @return The arrival.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent getArrival() {
+ return arrival_ == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance() : arrival_;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder getArrivalOrBuilder() {
+ return arrival_ == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance() : arrival_;
+ }
+
+ public static final int DEPARTURE_FIELD_NUMBER = 3;
+ private com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent departure_;
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ * @return Whether the departure field is set.
+ */
+ @java.lang.Override
+ public boolean hasDeparture() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ * @return The departure.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent getDeparture() {
+ return departure_ == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance() : departure_;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder getDepartureOrBuilder() {
+ return departure_ == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance() : departure_;
+ }
+
+ public static final int SCHEDULE_RELATIONSHIP_FIELD_NUMBER = 5;
+ private int scheduleRelationship_;
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship schedule_relationship = 5 [default = SCHEDULED];</code>
+ * @return Whether the scheduleRelationship field is set.
+ */
+ @java.lang.Override public boolean hasScheduleRelationship() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship schedule_relationship = 5 [default = SCHEDULED];</code>
+ * @return The scheduleRelationship.
+ */
+ @java.lang.Override public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship getScheduleRelationship() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship result = com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship.valueOf(scheduleRelationship_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship.SCHEDULED : result;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (hasArrival()) {
+ if (!getArrival().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasDeparture()) {
+ if (!getDeparture().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ output.writeUInt32(1, stopSequence_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeMessage(2, getArrival());
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ output.writeMessage(3, getDeparture());
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 4, stopId_);
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ output.writeEnum(5, scheduleRelationship_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(1, stopSequence_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, getArrival());
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getDeparture());
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, stopId_);
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(5, scheduleRelationship_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate other = (com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate) obj;
+
+ if (hasStopSequence() != other.hasStopSequence()) return false;
+ if (hasStopSequence()) {
+ if (getStopSequence()
+ != other.getStopSequence()) return false;
+ }
+ if (hasStopId() != other.hasStopId()) return false;
+ if (hasStopId()) {
+ if (!getStopId()
+ .equals(other.getStopId())) return false;
+ }
+ if (hasArrival() != other.hasArrival()) return false;
+ if (hasArrival()) {
+ if (!getArrival()
+ .equals(other.getArrival())) return false;
+ }
+ if (hasDeparture() != other.hasDeparture()) return false;
+ if (hasDeparture()) {
+ if (!getDeparture()
+ .equals(other.getDeparture())) return false;
+ }
+ if (hasScheduleRelationship() != other.hasScheduleRelationship()) return false;
+ if (hasScheduleRelationship()) {
+ if (scheduleRelationship_ != other.scheduleRelationship_) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasStopSequence()) {
+ hash = (37 * hash) + STOP_SEQUENCE_FIELD_NUMBER;
+ hash = (53 * hash) + getStopSequence();
+ }
+ if (hasStopId()) {
+ hash = (37 * hash) + STOP_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getStopId().hashCode();
+ }
+ if (hasArrival()) {
+ hash = (37 * hash) + ARRIVAL_FIELD_NUMBER;
+ hash = (53 * hash) + getArrival().hashCode();
+ }
+ if (hasDeparture()) {
+ hash = (37 * hash) + DEPARTURE_FIELD_NUMBER;
+ hash = (53 * hash) + getDeparture().hashCode();
+ }
+ if (hasScheduleRelationship()) {
+ hash = (37 * hash) + SCHEDULE_RELATIONSHIP_FIELD_NUMBER;
+ hash = (53 * hash) + scheduleRelationship_;
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * Realtime update for arrival and/or departure events for a given stop on a
+ * trip. Updates can be supplied for both past and future events.
+ * The producer is allowed, although not required, to drop past events.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TripUpdate.StopTimeUpdate}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.TripUpdate.StopTimeUpdate)
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeUpdate_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeUpdate_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.class, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ getArrivalFieldBuilder();
+ getDepartureFieldBuilder();
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ stopSequence_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ stopId_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (arrivalBuilder_ == null) {
+ arrival_ = null;
+ } else {
+ arrivalBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ if (departureBuilder_ == null) {
+ departure_ = null;
+ } else {
+ departureBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ scheduleRelationship_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000010);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_StopTimeUpdate_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate build() {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate result = new com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ result.stopSequence_ = stopSequence_;
+ to_bitField0_ |= 0x00000001;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.stopId_ = stopId_;
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ if (arrivalBuilder_ == null) {
+ result.arrival_ = arrival_;
+ } else {
+ result.arrival_ = arrivalBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000004;
+ }
+ if (((from_bitField0_ & 0x00000008) != 0)) {
+ if (departureBuilder_ == null) {
+ result.departure_ = departure_;
+ } else {
+ result.departure_ = departureBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000008;
+ }
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ result.scheduleRelationship_ = scheduleRelationship_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.getDefaultInstance()) return this;
+ if (other.hasStopSequence()) {
+ setStopSequence(other.getStopSequence());
+ }
+ if (other.hasStopId()) {
+ bitField0_ |= 0x00000002;
+ stopId_ = other.stopId_;
+ onChanged();
+ }
+ if (other.hasArrival()) {
+ mergeArrival(other.getArrival());
+ }
+ if (other.hasDeparture()) {
+ mergeDeparture(other.getDeparture());
+ }
+ if (other.hasScheduleRelationship()) {
+ setScheduleRelationship(other.getScheduleRelationship());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (hasArrival()) {
+ if (!getArrival().isInitialized()) {
+ return false;
+ }
+ }
+ if (hasDeparture()) {
+ if (!getDeparture().isInitialized()) {
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private int stopSequence_ ;
+ /**
+ * <pre>
+ * Must be the same as in stop_times.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional uint32 stop_sequence = 1;</code>
+ * @return Whether the stopSequence field is set.
+ */
+ @java.lang.Override
+ public boolean hasStopSequence() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Must be the same as in stop_times.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional uint32 stop_sequence = 1;</code>
+ * @return The stopSequence.
+ */
+ @java.lang.Override
+ public int getStopSequence() {
+ return stopSequence_;
+ }
+ /**
+ * <pre>
+ * Must be the same as in stop_times.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional uint32 stop_sequence = 1;</code>
+ * @param value The stopSequence to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStopSequence(int value) {
+ bitField0_ |= 0x00000001;
+ stopSequence_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Must be the same as in stop_times.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional uint32 stop_sequence = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearStopSequence() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ stopSequence_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object stopId_ = "";
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return Whether the stopId field is set.
+ */
+ public boolean hasStopId() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return The stopId.
+ */
+ public java.lang.String getStopId() {
+ java.lang.Object ref = stopId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ stopId_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return The bytes for stopId.
+ */
+ public com.google.protobuf.ByteString
+ getStopIdBytes() {
+ java.lang.Object ref = stopId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ stopId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @param value The stopId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStopId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ stopId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearStopId() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ stopId_ = getDefaultInstance().getStopId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Must be the same as in stops.txt in the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 4;</code>
+ * @param value The bytes for stopId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStopIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ stopId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent arrival_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder> arrivalBuilder_;
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ * @return Whether the arrival field is set.
+ */
+ public boolean hasArrival() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ * @return The arrival.
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent getArrival() {
+ if (arrivalBuilder_ == null) {
+ return arrival_ == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance() : arrival_;
+ } else {
+ return arrivalBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ */
+ public Builder setArrival(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent value) {
+ if (arrivalBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ arrival_ = value;
+ onChanged();
+ } else {
+ arrivalBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ */
+ public Builder setArrival(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder builderForValue) {
+ if (arrivalBuilder_ == null) {
+ arrival_ = builderForValue.build();
+ onChanged();
+ } else {
+ arrivalBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ */
+ public Builder mergeArrival(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent value) {
+ if (arrivalBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) != 0) &&
+ arrival_ != null &&
+ arrival_ != com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance()) {
+ arrival_ =
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.newBuilder(arrival_).mergeFrom(value).buildPartial();
+ } else {
+ arrival_ = value;
+ }
+ onChanged();
+ } else {
+ arrivalBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ */
+ public Builder clearArrival() {
+ if (arrivalBuilder_ == null) {
+ arrival_ = null;
+ onChanged();
+ } else {
+ arrivalBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder getArrivalBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getArrivalFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder getArrivalOrBuilder() {
+ if (arrivalBuilder_ != null) {
+ return arrivalBuilder_.getMessageOrBuilder();
+ } else {
+ return arrival_ == null ?
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance() : arrival_;
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder>
+ getArrivalFieldBuilder() {
+ if (arrivalBuilder_ == null) {
+ arrivalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder>(
+ getArrival(),
+ getParentForChildren(),
+ isClean());
+ arrival_ = null;
+ }
+ return arrivalBuilder_;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent departure_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder> departureBuilder_;
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ * @return Whether the departure field is set.
+ */
+ public boolean hasDeparture() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ * @return The departure.
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent getDeparture() {
+ if (departureBuilder_ == null) {
+ return departure_ == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance() : departure_;
+ } else {
+ return departureBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ */
+ public Builder setDeparture(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent value) {
+ if (departureBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ departure_ = value;
+ onChanged();
+ } else {
+ departureBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ */
+ public Builder setDeparture(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder builderForValue) {
+ if (departureBuilder_ == null) {
+ departure_ = builderForValue.build();
+ onChanged();
+ } else {
+ departureBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ */
+ public Builder mergeDeparture(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent value) {
+ if (departureBuilder_ == null) {
+ if (((bitField0_ & 0x00000008) != 0) &&
+ departure_ != null &&
+ departure_ != com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance()) {
+ departure_ =
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.newBuilder(departure_).mergeFrom(value).buildPartial();
+ } else {
+ departure_ = value;
+ }
+ onChanged();
+ } else {
+ departureBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ */
+ public Builder clearDeparture() {
+ if (departureBuilder_ == null) {
+ departure_ = null;
+ onChanged();
+ } else {
+ departureBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder getDepartureBuilder() {
+ bitField0_ |= 0x00000008;
+ onChanged();
+ return getDepartureFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder getDepartureOrBuilder() {
+ if (departureBuilder_ != null) {
+ return departureBuilder_.getMessageOrBuilder();
+ } else {
+ return departure_ == null ?
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.getDefaultInstance() : departure_;
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeEvent departure = 3;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder>
+ getDepartureFieldBuilder() {
+ if (departureBuilder_ == null) {
+ departureBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEventOrBuilder>(
+ getDeparture(),
+ getParentForChildren(),
+ isClean());
+ departure_ = null;
+ }
+ return departureBuilder_;
+ }
+
+ private int scheduleRelationship_ = 0;
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship schedule_relationship = 5 [default = SCHEDULED];</code>
+ * @return Whether the scheduleRelationship field is set.
+ */
+ @java.lang.Override public boolean hasScheduleRelationship() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship schedule_relationship = 5 [default = SCHEDULED];</code>
+ * @return The scheduleRelationship.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship getScheduleRelationship() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship result = com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship.valueOf(scheduleRelationship_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship.SCHEDULED : result;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship schedule_relationship = 5 [default = SCHEDULED];</code>
+ * @param value The scheduleRelationship to set.
+ * @return This builder for chaining.
+ */
+ public Builder setScheduleRelationship(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000010;
+ scheduleRelationship_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship schedule_relationship = 5 [default = SCHEDULED];</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearScheduleRelationship() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ scheduleRelationship_ = 0;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.TripUpdate.StopTimeUpdate)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.TripUpdate.StopTimeUpdate)
+ private static final com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<StopTimeUpdate>
+ PARSER = new com.google.protobuf.AbstractParser<StopTimeUpdate>() {
+ @java.lang.Override
+ public StopTimeUpdate parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new StopTimeUpdate(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<StopTimeUpdate> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<StopTimeUpdate> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ private int bitField0_;
+ public static final int TRIP_FIELD_NUMBER = 1;
+ private com.google.transit.realtime.GtfsRealtime.TripDescriptor trip_;
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return Whether the trip field is set.
+ */
+ @java.lang.Override
+ public boolean hasTrip() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return The trip.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor getTrip() {
+ return trip_ == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder getTripOrBuilder() {
+ return trip_ == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ }
+
+ public static final int VEHICLE_FIELD_NUMBER = 3;
+ private com.google.transit.realtime.GtfsRealtime.VehicleDescriptor vehicle_;
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ * @return Whether the vehicle field is set.
+ */
+ @java.lang.Override
+ public boolean hasVehicle() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ * @return The vehicle.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor getVehicle() {
+ return vehicle_ == null ? com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance() : vehicle_;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder getVehicleOrBuilder() {
+ return vehicle_ == null ? com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance() : vehicle_;
+ }
+
+ public static final int STOP_TIME_UPDATE_FIELD_NUMBER = 2;
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate> stopTimeUpdate_;
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ @java.lang.Override
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate> getStopTimeUpdateList() {
+ return stopTimeUpdate_;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ @java.lang.Override
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder>
+ getStopTimeUpdateOrBuilderList() {
+ return stopTimeUpdate_;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ @java.lang.Override
+ public int getStopTimeUpdateCount() {
+ return stopTimeUpdate_.size();
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate getStopTimeUpdate(int index) {
+ return stopTimeUpdate_.get(index);
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder getStopTimeUpdateOrBuilder(
+ int index) {
+ return stopTimeUpdate_.get(index);
+ }
+
+ public static final int TIMESTAMP_FIELD_NUMBER = 4;
+ private long timestamp_;
+ /**
+ * <pre>
+ * Moment at which the vehicle's real-time progress was measured. In POSIX
+ * time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 4;</code>
+ * @return Whether the timestamp field is set.
+ */
+ @java.lang.Override
+ public boolean hasTimestamp() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * Moment at which the vehicle's real-time progress was measured. In POSIX
+ * time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 4;</code>
+ * @return The timestamp.
+ */
+ @java.lang.Override
+ public long getTimestamp() {
+ return timestamp_;
+ }
+
+ public static final int DELAY_FIELD_NUMBER = 5;
+ private int delay_;
+ /**
+ * <pre>
+ * The current schedule deviation for the trip. Delay should only be
+ * specified when the prediction is given relative to some existing schedule
+ * in GTFS.
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * Delay information in StopTimeUpdates take precedent of trip-level delay
+ * information, such that trip-level delay is only propagated until the next
+ * stop along the trip with a StopTimeUpdate delay value specified.
+ * Feed providers are strongly encouraged to provide a TripUpdate.timestamp
+ * value indicating when the delay value was last updated, in order to
+ * evaluate the freshness of the data.
+ * NOTE: This field is still experimental, and subject to change. It may be
+ * formally adopted in the future.
+ * </pre>
+ *
+ * <code>optional int32 delay = 5;</code>
+ * @return Whether the delay field is set.
+ */
+ @java.lang.Override
+ public boolean hasDelay() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <pre>
+ * The current schedule deviation for the trip. Delay should only be
+ * specified when the prediction is given relative to some existing schedule
+ * in GTFS.
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * Delay information in StopTimeUpdates take precedent of trip-level delay
+ * information, such that trip-level delay is only propagated until the next
+ * stop along the trip with a StopTimeUpdate delay value specified.
+ * Feed providers are strongly encouraged to provide a TripUpdate.timestamp
+ * value indicating when the delay value was last updated, in order to
+ * evaluate the freshness of the data.
+ * NOTE: This field is still experimental, and subject to change. It may be
+ * formally adopted in the future.
+ * </pre>
+ *
+ * <code>optional int32 delay = 5;</code>
+ * @return The delay.
+ */
+ @java.lang.Override
+ public int getDelay() {
+ return delay_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasTrip()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getTrip().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (hasVehicle()) {
+ if (!getVehicle().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ for (int i = 0; i < getStopTimeUpdateCount(); i++) {
+ if (!getStopTimeUpdate(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.TripUpdate>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ output.writeMessage(1, getTrip());
+ }
+ for (int i = 0; i < stopTimeUpdate_.size(); i++) {
+ output.writeMessage(2, stopTimeUpdate_.get(i));
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ output.writeMessage(3, getVehicle());
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeUInt64(4, timestamp_);
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ output.writeInt32(5, delay_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, getTrip());
+ }
+ for (int i = 0; i < stopTimeUpdate_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, stopTimeUpdate_.get(i));
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getVehicle());
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(4, timestamp_);
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(5, delay_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.TripUpdate)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.TripUpdate other = (com.google.transit.realtime.GtfsRealtime.TripUpdate) obj;
+
+ if (hasTrip() != other.hasTrip()) return false;
+ if (hasTrip()) {
+ if (!getTrip()
+ .equals(other.getTrip())) return false;
+ }
+ if (hasVehicle() != other.hasVehicle()) return false;
+ if (hasVehicle()) {
+ if (!getVehicle()
+ .equals(other.getVehicle())) return false;
+ }
+ if (!getStopTimeUpdateList()
+ .equals(other.getStopTimeUpdateList())) return false;
+ if (hasTimestamp() != other.hasTimestamp()) return false;
+ if (hasTimestamp()) {
+ if (getTimestamp()
+ != other.getTimestamp()) return false;
+ }
+ if (hasDelay() != other.hasDelay()) return false;
+ if (hasDelay()) {
+ if (getDelay()
+ != other.getDelay()) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasTrip()) {
+ hash = (37 * hash) + TRIP_FIELD_NUMBER;
+ hash = (53 * hash) + getTrip().hashCode();
+ }
+ if (hasVehicle()) {
+ hash = (37 * hash) + VEHICLE_FIELD_NUMBER;
+ hash = (53 * hash) + getVehicle().hashCode();
+ }
+ if (getStopTimeUpdateCount() > 0) {
+ hash = (37 * hash) + STOP_TIME_UPDATE_FIELD_NUMBER;
+ hash = (53 * hash) + getStopTimeUpdateList().hashCode();
+ }
+ if (hasTimestamp()) {
+ hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getTimestamp());
+ }
+ if (hasDelay()) {
+ hash = (37 * hash) + DELAY_FIELD_NUMBER;
+ hash = (53 * hash) + getDelay();
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.TripUpdate prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * Realtime update of the progress of a vehicle along a trip.
+ * Depending on the value of ScheduleRelationship, a TripUpdate can specify:
+ * - A trip that proceeds along the schedule.
+ * - A trip that proceeds along a route but has no fixed schedule.
+ * - A trip that have been added or removed with regard to schedule.
+ * The updates can be for future, predicted arrival/departure events, or for
+ * past events that already occurred.
+ * Normally, updates should get more precise and more certain (see
+ * uncertainty below) as the events gets closer to current time.
+ * Even if that is not possible, the information for past events should be
+ * precise and certain. In particular, if an update points to time in the past
+ * but its update's uncertainty is not 0, the client should conclude that the
+ * update is a (wrong) prediction and that the trip has not completed yet.
+ * Note that the update can describe a trip that is already completed.
+ * To this end, it is enough to provide an update for the last stop of the trip.
+ * If the time of that is in the past, the client will conclude from that that
+ * the whole trip is in the past (it is possible, although inconsequential, to
+ * also provide updates for preceding stops).
+ * This option is most relevant for a trip that has completed ahead of schedule,
+ * but according to the schedule, the trip is still proceeding at the current
+ * time. Removing the updates for this trip could make the client assume
+ * that the trip is still proceeding.
+ * Note that the feed provider is allowed, but not required, to purge past
+ * updates - this is one case where this would be practically useful.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TripUpdate}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.TripUpdate)
+ com.google.transit.realtime.GtfsRealtime.TripUpdateOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.class, com.google.transit.realtime.GtfsRealtime.TripUpdate.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.TripUpdate.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ getTripFieldBuilder();
+ getVehicleFieldBuilder();
+ getStopTimeUpdateFieldBuilder();
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ if (tripBuilder_ == null) {
+ trip_ = null;
+ } else {
+ tripBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (vehicleBuilder_ == null) {
+ vehicle_ = null;
+ } else {
+ vehicleBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (stopTimeUpdateBuilder_ == null) {
+ stopTimeUpdate_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000004);
+ } else {
+ stopTimeUpdateBuilder_.clear();
+ }
+ timestamp_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ delay_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000010);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripUpdate_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.TripUpdate.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate build() {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate result = new com.google.transit.realtime.GtfsRealtime.TripUpdate(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ if (tripBuilder_ == null) {
+ result.trip_ = trip_;
+ } else {
+ result.trip_ = tripBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000001;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ if (vehicleBuilder_ == null) {
+ result.vehicle_ = vehicle_;
+ } else {
+ result.vehicle_ = vehicleBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000002;
+ }
+ if (stopTimeUpdateBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) != 0)) {
+ stopTimeUpdate_ = java.util.Collections.unmodifiableList(stopTimeUpdate_);
+ bitField0_ = (bitField0_ & ~0x00000004);
+ }
+ result.stopTimeUpdate_ = stopTimeUpdate_;
+ } else {
+ result.stopTimeUpdate_ = stopTimeUpdateBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000008) != 0)) {
+ result.timestamp_ = timestamp_;
+ to_bitField0_ |= 0x00000004;
+ }
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ result.delay_ = delay_;
+ to_bitField0_ |= 0x00000008;
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.TripUpdate) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.TripUpdate)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TripUpdate other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.TripUpdate.getDefaultInstance()) return this;
+ if (other.hasTrip()) {
+ mergeTrip(other.getTrip());
+ }
+ if (other.hasVehicle()) {
+ mergeVehicle(other.getVehicle());
+ }
+ if (stopTimeUpdateBuilder_ == null) {
+ if (!other.stopTimeUpdate_.isEmpty()) {
+ if (stopTimeUpdate_.isEmpty()) {
+ stopTimeUpdate_ = other.stopTimeUpdate_;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ } else {
+ ensureStopTimeUpdateIsMutable();
+ stopTimeUpdate_.addAll(other.stopTimeUpdate_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.stopTimeUpdate_.isEmpty()) {
+ if (stopTimeUpdateBuilder_.isEmpty()) {
+ stopTimeUpdateBuilder_.dispose();
+ stopTimeUpdateBuilder_ = null;
+ stopTimeUpdate_ = other.stopTimeUpdate_;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ stopTimeUpdateBuilder_ =
+ com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
+ getStopTimeUpdateFieldBuilder() : null;
+ } else {
+ stopTimeUpdateBuilder_.addAllMessages(other.stopTimeUpdate_);
+ }
+ }
+ }
+ if (other.hasTimestamp()) {
+ setTimestamp(other.getTimestamp());
+ }
+ if (other.hasDelay()) {
+ setDelay(other.getDelay());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!hasTrip()) {
+ return false;
+ }
+ if (!getTrip().isInitialized()) {
+ return false;
+ }
+ if (hasVehicle()) {
+ if (!getVehicle().isInitialized()) {
+ return false;
+ }
+ }
+ for (int i = 0; i < getStopTimeUpdateCount(); i++) {
+ if (!getStopTimeUpdate(i).isInitialized()) {
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.TripUpdate parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.TripUpdate) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.transit.realtime.GtfsRealtime.TripDescriptor trip_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder> tripBuilder_;
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return Whether the trip field is set.
+ */
+ public boolean hasTrip() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return The trip.
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor getTrip() {
+ if (tripBuilder_ == null) {
+ return trip_ == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ } else {
+ return tripBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public Builder setTrip(com.google.transit.realtime.GtfsRealtime.TripDescriptor value) {
+ if (tripBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ trip_ = value;
+ onChanged();
+ } else {
+ tripBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public Builder setTrip(
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder builderForValue) {
+ if (tripBuilder_ == null) {
+ trip_ = builderForValue.build();
+ onChanged();
+ } else {
+ tripBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public Builder mergeTrip(com.google.transit.realtime.GtfsRealtime.TripDescriptor value) {
+ if (tripBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) != 0) &&
+ trip_ != null &&
+ trip_ != com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance()) {
+ trip_ =
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.newBuilder(trip_).mergeFrom(value).buildPartial();
+ } else {
+ trip_ = value;
+ }
+ onChanged();
+ } else {
+ tripBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public Builder clearTrip() {
+ if (tripBuilder_ == null) {
+ trip_ = null;
+ onChanged();
+ } else {
+ tripBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder getTripBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getTripFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder getTripOrBuilder() {
+ if (tripBuilder_ != null) {
+ return tripBuilder_.getMessageOrBuilder();
+ } else {
+ return trip_ == null ?
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ }
+ }
+ /**
+ * <pre>
+ * The Trip that this message applies to. There can be at most one
+ * TripUpdate entity for each actual trip instance.
+ * If there is none, that means there is no prediction information available.
+ * It does *not* mean that the trip is progressing according to schedule.
+ * </pre>
+ *
+ * <code>required .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder>
+ getTripFieldBuilder() {
+ if (tripBuilder_ == null) {
+ tripBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder>(
+ getTrip(),
+ getParentForChildren(),
+ isClean());
+ trip_ = null;
+ }
+ return tripBuilder_;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.VehicleDescriptor vehicle_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder> vehicleBuilder_;
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ * @return Whether the vehicle field is set.
+ */
+ public boolean hasVehicle() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ * @return The vehicle.
+ */
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor getVehicle() {
+ if (vehicleBuilder_ == null) {
+ return vehicle_ == null ? com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance() : vehicle_;
+ } else {
+ return vehicleBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ */
+ public Builder setVehicle(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor value) {
+ if (vehicleBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ vehicle_ = value;
+ onChanged();
+ } else {
+ vehicleBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ */
+ public Builder setVehicle(
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder builderForValue) {
+ if (vehicleBuilder_ == null) {
+ vehicle_ = builderForValue.build();
+ onChanged();
+ } else {
+ vehicleBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ */
+ public Builder mergeVehicle(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor value) {
+ if (vehicleBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) != 0) &&
+ vehicle_ != null &&
+ vehicle_ != com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance()) {
+ vehicle_ =
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.newBuilder(vehicle_).mergeFrom(value).buildPartial();
+ } else {
+ vehicle_ = value;
+ }
+ onChanged();
+ } else {
+ vehicleBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ */
+ public Builder clearVehicle() {
+ if (vehicleBuilder_ == null) {
+ vehicle_ = null;
+ onChanged();
+ } else {
+ vehicleBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder getVehicleBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getVehicleFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder getVehicleOrBuilder() {
+ if (vehicleBuilder_ != null) {
+ return vehicleBuilder_.getMessageOrBuilder();
+ } else {
+ return vehicle_ == null ?
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance() : vehicle_;
+ }
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 3;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder>
+ getVehicleFieldBuilder() {
+ if (vehicleBuilder_ == null) {
+ vehicleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder>(
+ getVehicle(),
+ getParentForChildren(),
+ isClean());
+ vehicle_ = null;
+ }
+ return vehicleBuilder_;
+ }
+
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate> stopTimeUpdate_ =
+ java.util.Collections.emptyList();
+ private void ensureStopTimeUpdateIsMutable() {
+ if (!((bitField0_ & 0x00000004) != 0)) {
+ stopTimeUpdate_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate>(stopTimeUpdate_);
+ bitField0_ |= 0x00000004;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder> stopTimeUpdateBuilder_;
+
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate> getStopTimeUpdateList() {
+ if (stopTimeUpdateBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(stopTimeUpdate_);
+ } else {
+ return stopTimeUpdateBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public int getStopTimeUpdateCount() {
+ if (stopTimeUpdateBuilder_ == null) {
+ return stopTimeUpdate_.size();
+ } else {
+ return stopTimeUpdateBuilder_.getCount();
+ }
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate getStopTimeUpdate(int index) {
+ if (stopTimeUpdateBuilder_ == null) {
+ return stopTimeUpdate_.get(index);
+ } else {
+ return stopTimeUpdateBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public Builder setStopTimeUpdate(
+ int index, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate value) {
+ if (stopTimeUpdateBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureStopTimeUpdateIsMutable();
+ stopTimeUpdate_.set(index, value);
+ onChanged();
+ } else {
+ stopTimeUpdateBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public Builder setStopTimeUpdate(
+ int index, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder builderForValue) {
+ if (stopTimeUpdateBuilder_ == null) {
+ ensureStopTimeUpdateIsMutable();
+ stopTimeUpdate_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ stopTimeUpdateBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public Builder addStopTimeUpdate(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate value) {
+ if (stopTimeUpdateBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureStopTimeUpdateIsMutable();
+ stopTimeUpdate_.add(value);
+ onChanged();
+ } else {
+ stopTimeUpdateBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public Builder addStopTimeUpdate(
+ int index, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate value) {
+ if (stopTimeUpdateBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureStopTimeUpdateIsMutable();
+ stopTimeUpdate_.add(index, value);
+ onChanged();
+ } else {
+ stopTimeUpdateBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public Builder addStopTimeUpdate(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder builderForValue) {
+ if (stopTimeUpdateBuilder_ == null) {
+ ensureStopTimeUpdateIsMutable();
+ stopTimeUpdate_.add(builderForValue.build());
+ onChanged();
+ } else {
+ stopTimeUpdateBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public Builder addStopTimeUpdate(
+ int index, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder builderForValue) {
+ if (stopTimeUpdateBuilder_ == null) {
+ ensureStopTimeUpdateIsMutable();
+ stopTimeUpdate_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ stopTimeUpdateBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public Builder addAllStopTimeUpdate(
+ java.lang.Iterable<? extends com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate> values) {
+ if (stopTimeUpdateBuilder_ == null) {
+ ensureStopTimeUpdateIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, stopTimeUpdate_);
+ onChanged();
+ } else {
+ stopTimeUpdateBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public Builder clearStopTimeUpdate() {
+ if (stopTimeUpdateBuilder_ == null) {
+ stopTimeUpdate_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000004);
+ onChanged();
+ } else {
+ stopTimeUpdateBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public Builder removeStopTimeUpdate(int index) {
+ if (stopTimeUpdateBuilder_ == null) {
+ ensureStopTimeUpdateIsMutable();
+ stopTimeUpdate_.remove(index);
+ onChanged();
+ } else {
+ stopTimeUpdateBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder getStopTimeUpdateBuilder(
+ int index) {
+ return getStopTimeUpdateFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder getStopTimeUpdateOrBuilder(
+ int index) {
+ if (stopTimeUpdateBuilder_ == null) {
+ return stopTimeUpdate_.get(index); } else {
+ return stopTimeUpdateBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder>
+ getStopTimeUpdateOrBuilderList() {
+ if (stopTimeUpdateBuilder_ != null) {
+ return stopTimeUpdateBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(stopTimeUpdate_);
+ }
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder addStopTimeUpdateBuilder() {
+ return getStopTimeUpdateFieldBuilder().addBuilder(
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder addStopTimeUpdateBuilder(
+ int index) {
+ return getStopTimeUpdateFieldBuilder().addBuilder(
+ index, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * Updates to StopTimes for the trip (both future, i.e., predictions, and in
+ * some cases, past ones, i.e., those that already happened).
+ * The updates must be sorted by stop_sequence, and apply for all the
+ * following stops of the trip up to the next specified one.
+ * Example 1:
+ * For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+ * delay of 0 for stop_sequence of the current stop means that the trip is
+ * exactly on time.
+ * Example 2:
+ * For the same trip instance, 3 StopTimeUpdates are provided:
+ * - delay of 5 min for stop_sequence 3
+ * - delay of 1 min for stop_sequence 8
+ * - delay of unspecified duration for stop_sequence 10
+ * This will be interpreted as:
+ * - stop_sequences 3,4,5,6,7 have delay of 5 min.
+ * - stop_sequences 8,9 have delay of 1 min.
+ * - stop_sequences 10,... have unknown delay.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TripUpdate.StopTimeUpdate stop_time_update = 2;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder>
+ getStopTimeUpdateBuilderList() {
+ return getStopTimeUpdateFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder>
+ getStopTimeUpdateFieldBuilder() {
+ if (stopTimeUpdateBuilder_ == null) {
+ stopTimeUpdateBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.Builder, com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdateOrBuilder>(
+ stopTimeUpdate_,
+ ((bitField0_ & 0x00000004) != 0),
+ getParentForChildren(),
+ isClean());
+ stopTimeUpdate_ = null;
+ }
+ return stopTimeUpdateBuilder_;
+ }
+
+ private long timestamp_ ;
+ /**
+ * <pre>
+ * Moment at which the vehicle's real-time progress was measured. In POSIX
+ * time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 4;</code>
+ * @return Whether the timestamp field is set.
+ */
+ @java.lang.Override
+ public boolean hasTimestamp() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <pre>
+ * Moment at which the vehicle's real-time progress was measured. In POSIX
+ * time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 4;</code>
+ * @return The timestamp.
+ */
+ @java.lang.Override
+ public long getTimestamp() {
+ return timestamp_;
+ }
+ /**
+ * <pre>
+ * Moment at which the vehicle's real-time progress was measured. In POSIX
+ * time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 4;</code>
+ * @param value The timestamp to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTimestamp(long value) {
+ bitField0_ |= 0x00000008;
+ timestamp_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Moment at which the vehicle's real-time progress was measured. In POSIX
+ * time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 4;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearTimestamp() {
+ bitField0_ = (bitField0_ & ~0x00000008);
+ timestamp_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private int delay_ ;
+ /**
+ * <pre>
+ * The current schedule deviation for the trip. Delay should only be
+ * specified when the prediction is given relative to some existing schedule
+ * in GTFS.
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * Delay information in StopTimeUpdates take precedent of trip-level delay
+ * information, such that trip-level delay is only propagated until the next
+ * stop along the trip with a StopTimeUpdate delay value specified.
+ * Feed providers are strongly encouraged to provide a TripUpdate.timestamp
+ * value indicating when the delay value was last updated, in order to
+ * evaluate the freshness of the data.
+ * NOTE: This field is still experimental, and subject to change. It may be
+ * formally adopted in the future.
+ * </pre>
+ *
+ * <code>optional int32 delay = 5;</code>
+ * @return Whether the delay field is set.
+ */
+ @java.lang.Override
+ public boolean hasDelay() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <pre>
+ * The current schedule deviation for the trip. Delay should only be
+ * specified when the prediction is given relative to some existing schedule
+ * in GTFS.
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * Delay information in StopTimeUpdates take precedent of trip-level delay
+ * information, such that trip-level delay is only propagated until the next
+ * stop along the trip with a StopTimeUpdate delay value specified.
+ * Feed providers are strongly encouraged to provide a TripUpdate.timestamp
+ * value indicating when the delay value was last updated, in order to
+ * evaluate the freshness of the data.
+ * NOTE: This field is still experimental, and subject to change. It may be
+ * formally adopted in the future.
+ * </pre>
+ *
+ * <code>optional int32 delay = 5;</code>
+ * @return The delay.
+ */
+ @java.lang.Override
+ public int getDelay() {
+ return delay_;
+ }
+ /**
+ * <pre>
+ * The current schedule deviation for the trip. Delay should only be
+ * specified when the prediction is given relative to some existing schedule
+ * in GTFS.
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * Delay information in StopTimeUpdates take precedent of trip-level delay
+ * information, such that trip-level delay is only propagated until the next
+ * stop along the trip with a StopTimeUpdate delay value specified.
+ * Feed providers are strongly encouraged to provide a TripUpdate.timestamp
+ * value indicating when the delay value was last updated, in order to
+ * evaluate the freshness of the data.
+ * NOTE: This field is still experimental, and subject to change. It may be
+ * formally adopted in the future.
+ * </pre>
+ *
+ * <code>optional int32 delay = 5;</code>
+ * @param value The delay to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDelay(int value) {
+ bitField0_ |= 0x00000010;
+ delay_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The current schedule deviation for the trip. Delay should only be
+ * specified when the prediction is given relative to some existing schedule
+ * in GTFS.
+ * Delay (in seconds) can be positive (meaning that the vehicle is late) or
+ * negative (meaning that the vehicle is ahead of schedule). Delay of 0
+ * means that the vehicle is exactly on time.
+ * Delay information in StopTimeUpdates take precedent of trip-level delay
+ * information, such that trip-level delay is only propagated until the next
+ * stop along the trip with a StopTimeUpdate delay value specified.
+ * Feed providers are strongly encouraged to provide a TripUpdate.timestamp
+ * value indicating when the delay value was last updated, in order to
+ * evaluate the freshness of the data.
+ * NOTE: This field is still experimental, and subject to change. It may be
+ * formally adopted in the future.
+ * </pre>
+ *
+ * <code>optional int32 delay = 5;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearDelay() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ delay_ = 0;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.TripUpdate)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.TripUpdate)
+ private static final com.google.transit.realtime.GtfsRealtime.TripUpdate DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.TripUpdate();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TripUpdate getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<TripUpdate>
+ PARSER = new com.google.protobuf.AbstractParser<TripUpdate>() {
+ @java.lang.Override
+ public TripUpdate parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new TripUpdate(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<TripUpdate> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<TripUpdate> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripUpdate getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface VehiclePositionOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.VehiclePosition)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<VehiclePosition> {
+
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return Whether the trip field is set.
+ */
+ boolean hasTrip();
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return The trip.
+ */
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor getTrip();
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder getTripOrBuilder();
+
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ * @return Whether the vehicle field is set.
+ */
+ boolean hasVehicle();
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ * @return The vehicle.
+ */
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor getVehicle();
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder getVehicleOrBuilder();
+
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ * @return Whether the position field is set.
+ */
+ boolean hasPosition();
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ * @return The position.
+ */
+ com.google.transit.realtime.GtfsRealtime.Position getPosition();
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.PositionOrBuilder getPositionOrBuilder();
+
+ /**
+ * <pre>
+ * The stop sequence index of the current stop. The meaning of
+ * current_stop_sequence (i.e., the stop that it refers to) is determined by
+ * current_status.
+ * If current_status is missing IN_TRANSIT_TO is assumed.
+ * </pre>
+ *
+ * <code>optional uint32 current_stop_sequence = 3;</code>
+ * @return Whether the currentStopSequence field is set.
+ */
+ boolean hasCurrentStopSequence();
+ /**
+ * <pre>
+ * The stop sequence index of the current stop. The meaning of
+ * current_stop_sequence (i.e., the stop that it refers to) is determined by
+ * current_status.
+ * If current_status is missing IN_TRANSIT_TO is assumed.
+ * </pre>
+ *
+ * <code>optional uint32 current_stop_sequence = 3;</code>
+ * @return The currentStopSequence.
+ */
+ int getCurrentStopSequence();
+
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return Whether the stopId field is set.
+ */
+ boolean hasStopId();
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return The stopId.
+ */
+ java.lang.String getStopId();
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return The bytes for stopId.
+ */
+ com.google.protobuf.ByteString
+ getStopIdBytes();
+
+ /**
+ * <pre>
+ * The exact status of the vehicle with respect to the current stop.
+ * Ignored if current_stop_sequence is missing.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehiclePosition.VehicleStopStatus current_status = 4 [default = IN_TRANSIT_TO];</code>
+ * @return Whether the currentStatus field is set.
+ */
+ boolean hasCurrentStatus();
+ /**
+ * <pre>
+ * The exact status of the vehicle with respect to the current stop.
+ * Ignored if current_stop_sequence is missing.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehiclePosition.VehicleStopStatus current_status = 4 [default = IN_TRANSIT_TO];</code>
+ * @return The currentStatus.
+ */
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus getCurrentStatus();
+
+ /**
+ * <pre>
+ * Moment at which the vehicle's position was measured. In POSIX time
+ * (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 5;</code>
+ * @return Whether the timestamp field is set.
+ */
+ boolean hasTimestamp();
+ /**
+ * <pre>
+ * Moment at which the vehicle's position was measured. In POSIX time
+ * (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 5;</code>
+ * @return The timestamp.
+ */
+ long getTimestamp();
+
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.CongestionLevel congestion_level = 6;</code>
+ * @return Whether the congestionLevel field is set.
+ */
+ boolean hasCongestionLevel();
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.CongestionLevel congestion_level = 6;</code>
+ * @return The congestionLevel.
+ */
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel getCongestionLevel();
+
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.OccupancyStatus occupancy_status = 9;</code>
+ * @return Whether the occupancyStatus field is set.
+ */
+ boolean hasOccupancyStatus();
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.OccupancyStatus occupancy_status = 9;</code>
+ * @return The occupancyStatus.
+ */
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus getOccupancyStatus();
+ }
+ /**
+ * <pre>
+ * Realtime positioning information for a given vehicle.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.VehiclePosition}
+ */
+ public static final class VehiclePosition extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ VehiclePosition> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.VehiclePosition)
+ VehiclePositionOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use VehiclePosition.newBuilder() to construct.
+ private VehiclePosition(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.VehiclePosition, ?> builder) {
+ super(builder);
+ }
+ private VehiclePosition() {
+ stopId_ = "";
+ currentStatus_ = 2;
+ congestionLevel_ = 0;
+ occupancyStatus_ = 0;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new VehiclePosition();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private VehiclePosition(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ subBuilder = trip_.toBuilder();
+ }
+ trip_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.TripDescriptor.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(trip_);
+ trip_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 18: {
+ com.google.transit.realtime.GtfsRealtime.Position.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) != 0)) {
+ subBuilder = position_.toBuilder();
+ }
+ position_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.Position.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(position_);
+ position_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 24: {
+ bitField0_ |= 0x00000008;
+ currentStopSequence_ = input.readUInt32();
+ break;
+ }
+ case 32: {
+ int rawValue = input.readEnum();
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus value = com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(4, rawValue);
+ } else {
+ bitField0_ |= 0x00000020;
+ currentStatus_ = rawValue;
+ }
+ break;
+ }
+ case 40: {
+ bitField0_ |= 0x00000040;
+ timestamp_ = input.readUInt64();
+ break;
+ }
+ case 48: {
+ int rawValue = input.readEnum();
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel value = com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(6, rawValue);
+ } else {
+ bitField0_ |= 0x00000080;
+ congestionLevel_ = rawValue;
+ }
+ break;
+ }
+ case 58: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000010;
+ stopId_ = bs;
+ break;
+ }
+ case 66: {
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) != 0)) {
+ subBuilder = vehicle_.toBuilder();
+ }
+ vehicle_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(vehicle_);
+ vehicle_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 72: {
+ int rawValue = input.readEnum();
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus value = com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(9, rawValue);
+ } else {
+ bitField0_ |= 0x00000100;
+ occupancyStatus_ = rawValue;
+ }
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehiclePosition_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehiclePosition_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.class, com.google.transit.realtime.GtfsRealtime.VehiclePosition.Builder.class);
+ }
+
+ /**
+ * Protobuf enum {@code transit_realtime.VehiclePosition.VehicleStopStatus}
+ */
+ public enum VehicleStopStatus
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <pre>
+ * The vehicle is just about to arrive at the stop (on a stop
+ * display, the vehicle symbol typically flashes).
+ * </pre>
+ *
+ * <code>INCOMING_AT = 0;</code>
+ */
+ INCOMING_AT(0),
+ /**
+ * <pre>
+ * The vehicle is standing at the stop.
+ * </pre>
+ *
+ * <code>STOPPED_AT = 1;</code>
+ */
+ STOPPED_AT(1),
+ /**
+ * <pre>
+ * The vehicle has departed and is in transit to the next stop.
+ * </pre>
+ *
+ * <code>IN_TRANSIT_TO = 2;</code>
+ */
+ IN_TRANSIT_TO(2),
+ ;
+
+ /**
+ * <pre>
+ * The vehicle is just about to arrive at the stop (on a stop
+ * display, the vehicle symbol typically flashes).
+ * </pre>
+ *
+ * <code>INCOMING_AT = 0;</code>
+ */
+ public static final int INCOMING_AT_VALUE = 0;
+ /**
+ * <pre>
+ * The vehicle is standing at the stop.
+ * </pre>
+ *
+ * <code>STOPPED_AT = 1;</code>
+ */
+ public static final int STOPPED_AT_VALUE = 1;
+ /**
+ * <pre>
+ * The vehicle has departed and is in transit to the next stop.
+ * </pre>
+ *
+ * <code>IN_TRANSIT_TO = 2;</code>
+ */
+ public static final int IN_TRANSIT_TO_VALUE = 2;
+
+
+ public final int getNumber() {
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static VehicleStopStatus valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static VehicleStopStatus forNumber(int value) {
+ switch (value) {
+ case 0: return INCOMING_AT;
+ case 1: return STOPPED_AT;
+ case 2: return IN_TRANSIT_TO;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<VehicleStopStatus>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ VehicleStopStatus> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<VehicleStopStatus>() {
+ public VehicleStopStatus findValueByNumber(int number) {
+ return VehicleStopStatus.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final VehicleStopStatus[] VALUES = values();
+
+ public static VehicleStopStatus valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private VehicleStopStatus(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:transit_realtime.VehiclePosition.VehicleStopStatus)
+ }
+
+ /**
+ * <pre>
+ * Congestion level that is affecting this vehicle.
+ * </pre>
+ *
+ * Protobuf enum {@code transit_realtime.VehiclePosition.CongestionLevel}
+ */
+ public enum CongestionLevel
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN_CONGESTION_LEVEL = 0;</code>
+ */
+ UNKNOWN_CONGESTION_LEVEL(0),
+ /**
+ * <code>RUNNING_SMOOTHLY = 1;</code>
+ */
+ RUNNING_SMOOTHLY(1),
+ /**
+ * <code>STOP_AND_GO = 2;</code>
+ */
+ STOP_AND_GO(2),
+ /**
+ * <code>CONGESTION = 3;</code>
+ */
+ CONGESTION(3),
+ /**
+ * <pre>
+ * People leaving their cars.
+ * </pre>
+ *
+ * <code>SEVERE_CONGESTION = 4;</code>
+ */
+ SEVERE_CONGESTION(4),
+ ;
+
+ /**
+ * <code>UNKNOWN_CONGESTION_LEVEL = 0;</code>
+ */
+ public static final int UNKNOWN_CONGESTION_LEVEL_VALUE = 0;
+ /**
+ * <code>RUNNING_SMOOTHLY = 1;</code>
+ */
+ public static final int RUNNING_SMOOTHLY_VALUE = 1;
+ /**
+ * <code>STOP_AND_GO = 2;</code>
+ */
+ public static final int STOP_AND_GO_VALUE = 2;
+ /**
+ * <code>CONGESTION = 3;</code>
+ */
+ public static final int CONGESTION_VALUE = 3;
+ /**
+ * <pre>
+ * People leaving their cars.
+ * </pre>
+ *
+ * <code>SEVERE_CONGESTION = 4;</code>
+ */
+ public static final int SEVERE_CONGESTION_VALUE = 4;
+
+
+ public final int getNumber() {
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static CongestionLevel valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static CongestionLevel forNumber(int value) {
+ switch (value) {
+ case 0: return UNKNOWN_CONGESTION_LEVEL;
+ case 1: return RUNNING_SMOOTHLY;
+ case 2: return STOP_AND_GO;
+ case 3: return CONGESTION;
+ case 4: return SEVERE_CONGESTION;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<CongestionLevel>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ CongestionLevel> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<CongestionLevel>() {
+ public CongestionLevel findValueByNumber(int number) {
+ return CongestionLevel.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDescriptor().getEnumTypes().get(1);
+ }
+
+ private static final CongestionLevel[] VALUES = values();
+
+ public static CongestionLevel valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private CongestionLevel(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:transit_realtime.VehiclePosition.CongestionLevel)
+ }
+
+ /**
+ * <pre>
+ * The degree of passenger occupancy of the vehicle. This field is still
+ * experimental, and subject to change. It may be formally adopted in the
+ * future.
+ * </pre>
+ *
+ * Protobuf enum {@code transit_realtime.VehiclePosition.OccupancyStatus}
+ */
+ public enum OccupancyStatus
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <pre>
+ * The vehicle is considered empty by most measures, and has few or no
+ * passengers onboard, but is still accepting passengers.
+ * </pre>
+ *
+ * <code>EMPTY = 0;</code>
+ */
+ EMPTY(0),
+ /**
+ * <pre>
+ * The vehicle has a relatively large percentage of seats available.
+ * What percentage of free seats out of the total seats available is to be
+ * considered large enough to fall into this category is determined at the
+ * discretion of the producer.
+ * </pre>
+ *
+ * <code>MANY_SEATS_AVAILABLE = 1;</code>
+ */
+ MANY_SEATS_AVAILABLE(1),
+ /**
+ * <pre>
+ * The vehicle has a relatively small percentage of seats available.
+ * What percentage of free seats out of the total seats available is to be
+ * considered small enough to fall into this category is determined at the
+ * discretion of the feed producer.
+ * </pre>
+ *
+ * <code>FEW_SEATS_AVAILABLE = 2;</code>
+ */
+ FEW_SEATS_AVAILABLE(2),
+ /**
+ * <pre>
+ * The vehicle can currently accommodate only standing passengers.
+ * </pre>
+ *
+ * <code>STANDING_ROOM_ONLY = 3;</code>
+ */
+ STANDING_ROOM_ONLY(3),
+ /**
+ * <pre>
+ * The vehicle can currently accommodate only standing passengers
+ * and has limited space for them.
+ * </pre>
+ *
+ * <code>CRUSHED_STANDING_ROOM_ONLY = 4;</code>
+ */
+ CRUSHED_STANDING_ROOM_ONLY(4),
+ /**
+ * <pre>
+ * The vehicle is considered full by most measures, but may still be
+ * allowing passengers to board.
+ * </pre>
+ *
+ * <code>FULL = 5;</code>
+ */
+ FULL(5),
+ /**
+ * <pre>
+ * The vehicle is not accepting additional passengers.
+ * </pre>
+ *
+ * <code>NOT_ACCEPTING_PASSENGERS = 6;</code>
+ */
+ NOT_ACCEPTING_PASSENGERS(6),
+ ;
+
+ /**
+ * <pre>
+ * The vehicle is considered empty by most measures, and has few or no
+ * passengers onboard, but is still accepting passengers.
+ * </pre>
+ *
+ * <code>EMPTY = 0;</code>
+ */
+ public static final int EMPTY_VALUE = 0;
+ /**
+ * <pre>
+ * The vehicle has a relatively large percentage of seats available.
+ * What percentage of free seats out of the total seats available is to be
+ * considered large enough to fall into this category is determined at the
+ * discretion of the producer.
+ * </pre>
+ *
+ * <code>MANY_SEATS_AVAILABLE = 1;</code>
+ */
+ public static final int MANY_SEATS_AVAILABLE_VALUE = 1;
+ /**
+ * <pre>
+ * The vehicle has a relatively small percentage of seats available.
+ * What percentage of free seats out of the total seats available is to be
+ * considered small enough to fall into this category is determined at the
+ * discretion of the feed producer.
+ * </pre>
+ *
+ * <code>FEW_SEATS_AVAILABLE = 2;</code>
+ */
+ public static final int FEW_SEATS_AVAILABLE_VALUE = 2;
+ /**
+ * <pre>
+ * The vehicle can currently accommodate only standing passengers.
+ * </pre>
+ *
+ * <code>STANDING_ROOM_ONLY = 3;</code>
+ */
+ public static final int STANDING_ROOM_ONLY_VALUE = 3;
+ /**
+ * <pre>
+ * The vehicle can currently accommodate only standing passengers
+ * and has limited space for them.
+ * </pre>
+ *
+ * <code>CRUSHED_STANDING_ROOM_ONLY = 4;</code>
+ */
+ public static final int CRUSHED_STANDING_ROOM_ONLY_VALUE = 4;
+ /**
+ * <pre>
+ * The vehicle is considered full by most measures, but may still be
+ * allowing passengers to board.
+ * </pre>
+ *
+ * <code>FULL = 5;</code>
+ */
+ public static final int FULL_VALUE = 5;
+ /**
+ * <pre>
+ * The vehicle is not accepting additional passengers.
+ * </pre>
+ *
+ * <code>NOT_ACCEPTING_PASSENGERS = 6;</code>
+ */
+ public static final int NOT_ACCEPTING_PASSENGERS_VALUE = 6;
+
+
+ public final int getNumber() {
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static OccupancyStatus valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static OccupancyStatus forNumber(int value) {
+ switch (value) {
+ case 0: return EMPTY;
+ case 1: return MANY_SEATS_AVAILABLE;
+ case 2: return FEW_SEATS_AVAILABLE;
+ case 3: return STANDING_ROOM_ONLY;
+ case 4: return CRUSHED_STANDING_ROOM_ONLY;
+ case 5: return FULL;
+ case 6: return NOT_ACCEPTING_PASSENGERS;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<OccupancyStatus>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ OccupancyStatus> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<OccupancyStatus>() {
+ public OccupancyStatus findValueByNumber(int number) {
+ return OccupancyStatus.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDescriptor().getEnumTypes().get(2);
+ }
+
+ private static final OccupancyStatus[] VALUES = values();
+
+ public static OccupancyStatus valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private OccupancyStatus(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:transit_realtime.VehiclePosition.OccupancyStatus)
+ }
+
+ private int bitField0_;
+ public static final int TRIP_FIELD_NUMBER = 1;
+ private com.google.transit.realtime.GtfsRealtime.TripDescriptor trip_;
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return Whether the trip field is set.
+ */
+ @java.lang.Override
+ public boolean hasTrip() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return The trip.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor getTrip() {
+ return trip_ == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder getTripOrBuilder() {
+ return trip_ == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ }
+
+ public static final int VEHICLE_FIELD_NUMBER = 8;
+ private com.google.transit.realtime.GtfsRealtime.VehicleDescriptor vehicle_;
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ * @return Whether the vehicle field is set.
+ */
+ @java.lang.Override
+ public boolean hasVehicle() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ * @return The vehicle.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor getVehicle() {
+ return vehicle_ == null ? com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance() : vehicle_;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder getVehicleOrBuilder() {
+ return vehicle_ == null ? com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance() : vehicle_;
+ }
+
+ public static final int POSITION_FIELD_NUMBER = 2;
+ private com.google.transit.realtime.GtfsRealtime.Position position_;
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ * @return Whether the position field is set.
+ */
+ @java.lang.Override
+ public boolean hasPosition() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ * @return The position.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Position getPosition() {
+ return position_ == null ? com.google.transit.realtime.GtfsRealtime.Position.getDefaultInstance() : position_;
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.PositionOrBuilder getPositionOrBuilder() {
+ return position_ == null ? com.google.transit.realtime.GtfsRealtime.Position.getDefaultInstance() : position_;
+ }
+
+ public static final int CURRENT_STOP_SEQUENCE_FIELD_NUMBER = 3;
+ private int currentStopSequence_;
+ /**
+ * <pre>
+ * The stop sequence index of the current stop. The meaning of
+ * current_stop_sequence (i.e., the stop that it refers to) is determined by
+ * current_status.
+ * If current_status is missing IN_TRANSIT_TO is assumed.
+ * </pre>
+ *
+ * <code>optional uint32 current_stop_sequence = 3;</code>
+ * @return Whether the currentStopSequence field is set.
+ */
+ @java.lang.Override
+ public boolean hasCurrentStopSequence() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <pre>
+ * The stop sequence index of the current stop. The meaning of
+ * current_stop_sequence (i.e., the stop that it refers to) is determined by
+ * current_status.
+ * If current_status is missing IN_TRANSIT_TO is assumed.
+ * </pre>
+ *
+ * <code>optional uint32 current_stop_sequence = 3;</code>
+ * @return The currentStopSequence.
+ */
+ @java.lang.Override
+ public int getCurrentStopSequence() {
+ return currentStopSequence_;
+ }
+
+ public static final int STOP_ID_FIELD_NUMBER = 7;
+ private volatile java.lang.Object stopId_;
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return Whether the stopId field is set.
+ */
+ @java.lang.Override
+ public boolean hasStopId() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return The stopId.
+ */
+ @java.lang.Override
+ public java.lang.String getStopId() {
+ java.lang.Object ref = stopId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ stopId_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return The bytes for stopId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getStopIdBytes() {
+ java.lang.Object ref = stopId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ stopId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int CURRENT_STATUS_FIELD_NUMBER = 4;
+ private int currentStatus_;
+ /**
+ * <pre>
+ * The exact status of the vehicle with respect to the current stop.
+ * Ignored if current_stop_sequence is missing.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehiclePosition.VehicleStopStatus current_status = 4 [default = IN_TRANSIT_TO];</code>
+ * @return Whether the currentStatus field is set.
+ */
+ @java.lang.Override public boolean hasCurrentStatus() {
+ return ((bitField0_ & 0x00000020) != 0);
+ }
+ /**
+ * <pre>
+ * The exact status of the vehicle with respect to the current stop.
+ * Ignored if current_stop_sequence is missing.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehiclePosition.VehicleStopStatus current_status = 4 [default = IN_TRANSIT_TO];</code>
+ * @return The currentStatus.
+ */
+ @java.lang.Override public com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus getCurrentStatus() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus result = com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus.valueOf(currentStatus_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus.IN_TRANSIT_TO : result;
+ }
+
+ public static final int TIMESTAMP_FIELD_NUMBER = 5;
+ private long timestamp_;
+ /**
+ * <pre>
+ * Moment at which the vehicle's position was measured. In POSIX time
+ * (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 5;</code>
+ * @return Whether the timestamp field is set.
+ */
+ @java.lang.Override
+ public boolean hasTimestamp() {
+ return ((bitField0_ & 0x00000040) != 0);
+ }
+ /**
+ * <pre>
+ * Moment at which the vehicle's position was measured. In POSIX time
+ * (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 5;</code>
+ * @return The timestamp.
+ */
+ @java.lang.Override
+ public long getTimestamp() {
+ return timestamp_;
+ }
+
+ public static final int CONGESTION_LEVEL_FIELD_NUMBER = 6;
+ private int congestionLevel_;
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.CongestionLevel congestion_level = 6;</code>
+ * @return Whether the congestionLevel field is set.
+ */
+ @java.lang.Override public boolean hasCongestionLevel() {
+ return ((bitField0_ & 0x00000080) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.CongestionLevel congestion_level = 6;</code>
+ * @return The congestionLevel.
+ */
+ @java.lang.Override public com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel getCongestionLevel() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel result = com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel.valueOf(congestionLevel_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel.UNKNOWN_CONGESTION_LEVEL : result;
+ }
+
+ public static final int OCCUPANCY_STATUS_FIELD_NUMBER = 9;
+ private int occupancyStatus_;
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.OccupancyStatus occupancy_status = 9;</code>
+ * @return Whether the occupancyStatus field is set.
+ */
+ @java.lang.Override public boolean hasOccupancyStatus() {
+ return ((bitField0_ & 0x00000100) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.OccupancyStatus occupancy_status = 9;</code>
+ * @return The occupancyStatus.
+ */
+ @java.lang.Override public com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus getOccupancyStatus() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus result = com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus.valueOf(occupancyStatus_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus.EMPTY : result;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (hasTrip()) {
+ if (!getTrip().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasVehicle()) {
+ if (!getVehicle().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasPosition()) {
+ if (!getPosition().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.VehiclePosition>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ output.writeMessage(1, getTrip());
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeMessage(2, getPosition());
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ output.writeUInt32(3, currentStopSequence_);
+ }
+ if (((bitField0_ & 0x00000020) != 0)) {
+ output.writeEnum(4, currentStatus_);
+ }
+ if (((bitField0_ & 0x00000040) != 0)) {
+ output.writeUInt64(5, timestamp_);
+ }
+ if (((bitField0_ & 0x00000080) != 0)) {
+ output.writeEnum(6, congestionLevel_);
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 7, stopId_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ output.writeMessage(8, getVehicle());
+ }
+ if (((bitField0_ & 0x00000100) != 0)) {
+ output.writeEnum(9, occupancyStatus_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, getTrip());
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, getPosition());
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(3, currentStopSequence_);
+ }
+ if (((bitField0_ & 0x00000020) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(4, currentStatus_);
+ }
+ if (((bitField0_ & 0x00000040) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(5, timestamp_);
+ }
+ if (((bitField0_ & 0x00000080) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(6, congestionLevel_);
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, stopId_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(8, getVehicle());
+ }
+ if (((bitField0_ & 0x00000100) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(9, occupancyStatus_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.VehiclePosition)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition other = (com.google.transit.realtime.GtfsRealtime.VehiclePosition) obj;
+
+ if (hasTrip() != other.hasTrip()) return false;
+ if (hasTrip()) {
+ if (!getTrip()
+ .equals(other.getTrip())) return false;
+ }
+ if (hasVehicle() != other.hasVehicle()) return false;
+ if (hasVehicle()) {
+ if (!getVehicle()
+ .equals(other.getVehicle())) return false;
+ }
+ if (hasPosition() != other.hasPosition()) return false;
+ if (hasPosition()) {
+ if (!getPosition()
+ .equals(other.getPosition())) return false;
+ }
+ if (hasCurrentStopSequence() != other.hasCurrentStopSequence()) return false;
+ if (hasCurrentStopSequence()) {
+ if (getCurrentStopSequence()
+ != other.getCurrentStopSequence()) return false;
+ }
+ if (hasStopId() != other.hasStopId()) return false;
+ if (hasStopId()) {
+ if (!getStopId()
+ .equals(other.getStopId())) return false;
+ }
+ if (hasCurrentStatus() != other.hasCurrentStatus()) return false;
+ if (hasCurrentStatus()) {
+ if (currentStatus_ != other.currentStatus_) return false;
+ }
+ if (hasTimestamp() != other.hasTimestamp()) return false;
+ if (hasTimestamp()) {
+ if (getTimestamp()
+ != other.getTimestamp()) return false;
+ }
+ if (hasCongestionLevel() != other.hasCongestionLevel()) return false;
+ if (hasCongestionLevel()) {
+ if (congestionLevel_ != other.congestionLevel_) return false;
+ }
+ if (hasOccupancyStatus() != other.hasOccupancyStatus()) return false;
+ if (hasOccupancyStatus()) {
+ if (occupancyStatus_ != other.occupancyStatus_) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasTrip()) {
+ hash = (37 * hash) + TRIP_FIELD_NUMBER;
+ hash = (53 * hash) + getTrip().hashCode();
+ }
+ if (hasVehicle()) {
+ hash = (37 * hash) + VEHICLE_FIELD_NUMBER;
+ hash = (53 * hash) + getVehicle().hashCode();
+ }
+ if (hasPosition()) {
+ hash = (37 * hash) + POSITION_FIELD_NUMBER;
+ hash = (53 * hash) + getPosition().hashCode();
+ }
+ if (hasCurrentStopSequence()) {
+ hash = (37 * hash) + CURRENT_STOP_SEQUENCE_FIELD_NUMBER;
+ hash = (53 * hash) + getCurrentStopSequence();
+ }
+ if (hasStopId()) {
+ hash = (37 * hash) + STOP_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getStopId().hashCode();
+ }
+ if (hasCurrentStatus()) {
+ hash = (37 * hash) + CURRENT_STATUS_FIELD_NUMBER;
+ hash = (53 * hash) + currentStatus_;
+ }
+ if (hasTimestamp()) {
+ hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getTimestamp());
+ }
+ if (hasCongestionLevel()) {
+ hash = (37 * hash) + CONGESTION_LEVEL_FIELD_NUMBER;
+ hash = (53 * hash) + congestionLevel_;
+ }
+ if (hasOccupancyStatus()) {
+ hash = (37 * hash) + OCCUPANCY_STATUS_FIELD_NUMBER;
+ hash = (53 * hash) + occupancyStatus_;
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.VehiclePosition prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * Realtime positioning information for a given vehicle.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.VehiclePosition}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.VehiclePosition)
+ com.google.transit.realtime.GtfsRealtime.VehiclePositionOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehiclePosition_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehiclePosition_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.class, com.google.transit.realtime.GtfsRealtime.VehiclePosition.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.VehiclePosition.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ getTripFieldBuilder();
+ getVehicleFieldBuilder();
+ getPositionFieldBuilder();
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ if (tripBuilder_ == null) {
+ trip_ = null;
+ } else {
+ tripBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (vehicleBuilder_ == null) {
+ vehicle_ = null;
+ } else {
+ vehicleBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (positionBuilder_ == null) {
+ position_ = null;
+ } else {
+ positionBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ currentStopSequence_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ stopId_ = "";
+ bitField0_ = (bitField0_ & ~0x00000010);
+ currentStatus_ = 2;
+ bitField0_ = (bitField0_ & ~0x00000020);
+ timestamp_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000040);
+ congestionLevel_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000080);
+ occupancyStatus_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000100);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehiclePosition_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition build() {
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition result = new com.google.transit.realtime.GtfsRealtime.VehiclePosition(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ if (tripBuilder_ == null) {
+ result.trip_ = trip_;
+ } else {
+ result.trip_ = tripBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000001;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ if (vehicleBuilder_ == null) {
+ result.vehicle_ = vehicle_;
+ } else {
+ result.vehicle_ = vehicleBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000002;
+ }
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ if (positionBuilder_ == null) {
+ result.position_ = position_;
+ } else {
+ result.position_ = positionBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000004;
+ }
+ if (((from_bitField0_ & 0x00000008) != 0)) {
+ result.currentStopSequence_ = currentStopSequence_;
+ to_bitField0_ |= 0x00000008;
+ }
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ result.stopId_ = stopId_;
+ if (((from_bitField0_ & 0x00000020) != 0)) {
+ to_bitField0_ |= 0x00000020;
+ }
+ result.currentStatus_ = currentStatus_;
+ if (((from_bitField0_ & 0x00000040) != 0)) {
+ result.timestamp_ = timestamp_;
+ to_bitField0_ |= 0x00000040;
+ }
+ if (((from_bitField0_ & 0x00000080) != 0)) {
+ to_bitField0_ |= 0x00000080;
+ }
+ result.congestionLevel_ = congestionLevel_;
+ if (((from_bitField0_ & 0x00000100) != 0)) {
+ to_bitField0_ |= 0x00000100;
+ }
+ result.occupancyStatus_ = occupancyStatus_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.VehiclePosition) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.VehiclePosition)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.VehiclePosition other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.VehiclePosition.getDefaultInstance()) return this;
+ if (other.hasTrip()) {
+ mergeTrip(other.getTrip());
+ }
+ if (other.hasVehicle()) {
+ mergeVehicle(other.getVehicle());
+ }
+ if (other.hasPosition()) {
+ mergePosition(other.getPosition());
+ }
+ if (other.hasCurrentStopSequence()) {
+ setCurrentStopSequence(other.getCurrentStopSequence());
+ }
+ if (other.hasStopId()) {
+ bitField0_ |= 0x00000010;
+ stopId_ = other.stopId_;
+ onChanged();
+ }
+ if (other.hasCurrentStatus()) {
+ setCurrentStatus(other.getCurrentStatus());
+ }
+ if (other.hasTimestamp()) {
+ setTimestamp(other.getTimestamp());
+ }
+ if (other.hasCongestionLevel()) {
+ setCongestionLevel(other.getCongestionLevel());
+ }
+ if (other.hasOccupancyStatus()) {
+ setOccupancyStatus(other.getOccupancyStatus());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (hasTrip()) {
+ if (!getTrip().isInitialized()) {
+ return false;
+ }
+ }
+ if (hasVehicle()) {
+ if (!getVehicle().isInitialized()) {
+ return false;
+ }
+ }
+ if (hasPosition()) {
+ if (!getPosition().isInitialized()) {
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.VehiclePosition) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.transit.realtime.GtfsRealtime.TripDescriptor trip_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder> tripBuilder_;
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return Whether the trip field is set.
+ */
+ public boolean hasTrip() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ * @return The trip.
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor getTrip() {
+ if (tripBuilder_ == null) {
+ return trip_ == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ } else {
+ return tripBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public Builder setTrip(com.google.transit.realtime.GtfsRealtime.TripDescriptor value) {
+ if (tripBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ trip_ = value;
+ onChanged();
+ } else {
+ tripBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public Builder setTrip(
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder builderForValue) {
+ if (tripBuilder_ == null) {
+ trip_ = builderForValue.build();
+ onChanged();
+ } else {
+ tripBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public Builder mergeTrip(com.google.transit.realtime.GtfsRealtime.TripDescriptor value) {
+ if (tripBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) != 0) &&
+ trip_ != null &&
+ trip_ != com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance()) {
+ trip_ =
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.newBuilder(trip_).mergeFrom(value).buildPartial();
+ } else {
+ trip_ = value;
+ }
+ onChanged();
+ } else {
+ tripBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public Builder clearTrip() {
+ if (tripBuilder_ == null) {
+ trip_ = null;
+ onChanged();
+ } else {
+ tripBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder getTripBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getTripFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder getTripOrBuilder() {
+ if (tripBuilder_ != null) {
+ return tripBuilder_.getMessageOrBuilder();
+ } else {
+ return trip_ == null ?
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ }
+ }
+ /**
+ * <pre>
+ * The Trip that this vehicle is serving.
+ * Can be empty or partial if the vehicle can not be identified with a given
+ * trip instance.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TripDescriptor trip = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder>
+ getTripFieldBuilder() {
+ if (tripBuilder_ == null) {
+ tripBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder>(
+ getTrip(),
+ getParentForChildren(),
+ isClean());
+ trip_ = null;
+ }
+ return tripBuilder_;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.VehicleDescriptor vehicle_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder> vehicleBuilder_;
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ * @return Whether the vehicle field is set.
+ */
+ public boolean hasVehicle() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ * @return The vehicle.
+ */
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor getVehicle() {
+ if (vehicleBuilder_ == null) {
+ return vehicle_ == null ? com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance() : vehicle_;
+ } else {
+ return vehicleBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ */
+ public Builder setVehicle(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor value) {
+ if (vehicleBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ vehicle_ = value;
+ onChanged();
+ } else {
+ vehicleBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ */
+ public Builder setVehicle(
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder builderForValue) {
+ if (vehicleBuilder_ == null) {
+ vehicle_ = builderForValue.build();
+ onChanged();
+ } else {
+ vehicleBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ */
+ public Builder mergeVehicle(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor value) {
+ if (vehicleBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) != 0) &&
+ vehicle_ != null &&
+ vehicle_ != com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance()) {
+ vehicle_ =
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.newBuilder(vehicle_).mergeFrom(value).buildPartial();
+ } else {
+ vehicle_ = value;
+ }
+ onChanged();
+ } else {
+ vehicleBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ */
+ public Builder clearVehicle() {
+ if (vehicleBuilder_ == null) {
+ vehicle_ = null;
+ onChanged();
+ } else {
+ vehicleBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder getVehicleBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getVehicleFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder getVehicleOrBuilder() {
+ if (vehicleBuilder_ != null) {
+ return vehicleBuilder_.getMessageOrBuilder();
+ } else {
+ return vehicle_ == null ?
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance() : vehicle_;
+ }
+ }
+ /**
+ * <pre>
+ * Additional information on the vehicle that is serving this trip.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehicleDescriptor vehicle = 8;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder>
+ getVehicleFieldBuilder() {
+ if (vehicleBuilder_ == null) {
+ vehicleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder>(
+ getVehicle(),
+ getParentForChildren(),
+ isClean());
+ vehicle_ = null;
+ }
+ return vehicleBuilder_;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.Position position_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.Position, com.google.transit.realtime.GtfsRealtime.Position.Builder, com.google.transit.realtime.GtfsRealtime.PositionOrBuilder> positionBuilder_;
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ * @return Whether the position field is set.
+ */
+ public boolean hasPosition() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ * @return The position.
+ */
+ public com.google.transit.realtime.GtfsRealtime.Position getPosition() {
+ if (positionBuilder_ == null) {
+ return position_ == null ? com.google.transit.realtime.GtfsRealtime.Position.getDefaultInstance() : position_;
+ } else {
+ return positionBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ */
+ public Builder setPosition(com.google.transit.realtime.GtfsRealtime.Position value) {
+ if (positionBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ position_ = value;
+ onChanged();
+ } else {
+ positionBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ */
+ public Builder setPosition(
+ com.google.transit.realtime.GtfsRealtime.Position.Builder builderForValue) {
+ if (positionBuilder_ == null) {
+ position_ = builderForValue.build();
+ onChanged();
+ } else {
+ positionBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ */
+ public Builder mergePosition(com.google.transit.realtime.GtfsRealtime.Position value) {
+ if (positionBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) != 0) &&
+ position_ != null &&
+ position_ != com.google.transit.realtime.GtfsRealtime.Position.getDefaultInstance()) {
+ position_ =
+ com.google.transit.realtime.GtfsRealtime.Position.newBuilder(position_).mergeFrom(value).buildPartial();
+ } else {
+ position_ = value;
+ }
+ onChanged();
+ } else {
+ positionBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ */
+ public Builder clearPosition() {
+ if (positionBuilder_ == null) {
+ position_ = null;
+ onChanged();
+ } else {
+ positionBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.Position.Builder getPositionBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getPositionFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.PositionOrBuilder getPositionOrBuilder() {
+ if (positionBuilder_ != null) {
+ return positionBuilder_.getMessageOrBuilder();
+ } else {
+ return position_ == null ?
+ com.google.transit.realtime.GtfsRealtime.Position.getDefaultInstance() : position_;
+ }
+ }
+ /**
+ * <pre>
+ * Current position of this vehicle.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.Position position = 2;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.Position, com.google.transit.realtime.GtfsRealtime.Position.Builder, com.google.transit.realtime.GtfsRealtime.PositionOrBuilder>
+ getPositionFieldBuilder() {
+ if (positionBuilder_ == null) {
+ positionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.Position, com.google.transit.realtime.GtfsRealtime.Position.Builder, com.google.transit.realtime.GtfsRealtime.PositionOrBuilder>(
+ getPosition(),
+ getParentForChildren(),
+ isClean());
+ position_ = null;
+ }
+ return positionBuilder_;
+ }
+
+ private int currentStopSequence_ ;
+ /**
+ * <pre>
+ * The stop sequence index of the current stop. The meaning of
+ * current_stop_sequence (i.e., the stop that it refers to) is determined by
+ * current_status.
+ * If current_status is missing IN_TRANSIT_TO is assumed.
+ * </pre>
+ *
+ * <code>optional uint32 current_stop_sequence = 3;</code>
+ * @return Whether the currentStopSequence field is set.
+ */
+ @java.lang.Override
+ public boolean hasCurrentStopSequence() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <pre>
+ * The stop sequence index of the current stop. The meaning of
+ * current_stop_sequence (i.e., the stop that it refers to) is determined by
+ * current_status.
+ * If current_status is missing IN_TRANSIT_TO is assumed.
+ * </pre>
+ *
+ * <code>optional uint32 current_stop_sequence = 3;</code>
+ * @return The currentStopSequence.
+ */
+ @java.lang.Override
+ public int getCurrentStopSequence() {
+ return currentStopSequence_;
+ }
+ /**
+ * <pre>
+ * The stop sequence index of the current stop. The meaning of
+ * current_stop_sequence (i.e., the stop that it refers to) is determined by
+ * current_status.
+ * If current_status is missing IN_TRANSIT_TO is assumed.
+ * </pre>
+ *
+ * <code>optional uint32 current_stop_sequence = 3;</code>
+ * @param value The currentStopSequence to set.
+ * @return This builder for chaining.
+ */
+ public Builder setCurrentStopSequence(int value) {
+ bitField0_ |= 0x00000008;
+ currentStopSequence_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The stop sequence index of the current stop. The meaning of
+ * current_stop_sequence (i.e., the stop that it refers to) is determined by
+ * current_status.
+ * If current_status is missing IN_TRANSIT_TO is assumed.
+ * </pre>
+ *
+ * <code>optional uint32 current_stop_sequence = 3;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearCurrentStopSequence() {
+ bitField0_ = (bitField0_ & ~0x00000008);
+ currentStopSequence_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object stopId_ = "";
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return Whether the stopId field is set.
+ */
+ public boolean hasStopId() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return The stopId.
+ */
+ public java.lang.String getStopId() {
+ java.lang.Object ref = stopId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ stopId_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return The bytes for stopId.
+ */
+ public com.google.protobuf.ByteString
+ getStopIdBytes() {
+ java.lang.Object ref = stopId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ stopId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @param value The stopId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStopId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000010;
+ stopId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearStopId() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ stopId_ = getDefaultInstance().getStopId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Identifies the current stop. The value must be the same as in stops.txt in
+ * the corresponding GTFS feed.
+ * </pre>
+ *
+ * <code>optional string stop_id = 7;</code>
+ * @param value The bytes for stopId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStopIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000010;
+ stopId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private int currentStatus_ = 2;
+ /**
+ * <pre>
+ * The exact status of the vehicle with respect to the current stop.
+ * Ignored if current_stop_sequence is missing.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehiclePosition.VehicleStopStatus current_status = 4 [default = IN_TRANSIT_TO];</code>
+ * @return Whether the currentStatus field is set.
+ */
+ @java.lang.Override public boolean hasCurrentStatus() {
+ return ((bitField0_ & 0x00000020) != 0);
+ }
+ /**
+ * <pre>
+ * The exact status of the vehicle with respect to the current stop.
+ * Ignored if current_stop_sequence is missing.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehiclePosition.VehicleStopStatus current_status = 4 [default = IN_TRANSIT_TO];</code>
+ * @return The currentStatus.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus getCurrentStatus() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus result = com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus.valueOf(currentStatus_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus.IN_TRANSIT_TO : result;
+ }
+ /**
+ * <pre>
+ * The exact status of the vehicle with respect to the current stop.
+ * Ignored if current_stop_sequence is missing.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehiclePosition.VehicleStopStatus current_status = 4 [default = IN_TRANSIT_TO];</code>
+ * @param value The currentStatus to set.
+ * @return This builder for chaining.
+ */
+ public Builder setCurrentStatus(com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000020;
+ currentStatus_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The exact status of the vehicle with respect to the current stop.
+ * Ignored if current_stop_sequence is missing.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.VehiclePosition.VehicleStopStatus current_status = 4 [default = IN_TRANSIT_TO];</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearCurrentStatus() {
+ bitField0_ = (bitField0_ & ~0x00000020);
+ currentStatus_ = 2;
+ onChanged();
+ return this;
+ }
+
+ private long timestamp_ ;
+ /**
+ * <pre>
+ * Moment at which the vehicle's position was measured. In POSIX time
+ * (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 5;</code>
+ * @return Whether the timestamp field is set.
+ */
+ @java.lang.Override
+ public boolean hasTimestamp() {
+ return ((bitField0_ & 0x00000040) != 0);
+ }
+ /**
+ * <pre>
+ * Moment at which the vehicle's position was measured. In POSIX time
+ * (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 5;</code>
+ * @return The timestamp.
+ */
+ @java.lang.Override
+ public long getTimestamp() {
+ return timestamp_;
+ }
+ /**
+ * <pre>
+ * Moment at which the vehicle's position was measured. In POSIX time
+ * (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 5;</code>
+ * @param value The timestamp to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTimestamp(long value) {
+ bitField0_ |= 0x00000040;
+ timestamp_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Moment at which the vehicle's position was measured. In POSIX time
+ * (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
+ * </pre>
+ *
+ * <code>optional uint64 timestamp = 5;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearTimestamp() {
+ bitField0_ = (bitField0_ & ~0x00000040);
+ timestamp_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private int congestionLevel_ = 0;
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.CongestionLevel congestion_level = 6;</code>
+ * @return Whether the congestionLevel field is set.
+ */
+ @java.lang.Override public boolean hasCongestionLevel() {
+ return ((bitField0_ & 0x00000080) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.CongestionLevel congestion_level = 6;</code>
+ * @return The congestionLevel.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel getCongestionLevel() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel result = com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel.valueOf(congestionLevel_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel.UNKNOWN_CONGESTION_LEVEL : result;
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.CongestionLevel congestion_level = 6;</code>
+ * @param value The congestionLevel to set.
+ * @return This builder for chaining.
+ */
+ public Builder setCongestionLevel(com.google.transit.realtime.GtfsRealtime.VehiclePosition.CongestionLevel value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000080;
+ congestionLevel_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.CongestionLevel congestion_level = 6;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearCongestionLevel() {
+ bitField0_ = (bitField0_ & ~0x00000080);
+ congestionLevel_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private int occupancyStatus_ = 0;
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.OccupancyStatus occupancy_status = 9;</code>
+ * @return Whether the occupancyStatus field is set.
+ */
+ @java.lang.Override public boolean hasOccupancyStatus() {
+ return ((bitField0_ & 0x00000100) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.OccupancyStatus occupancy_status = 9;</code>
+ * @return The occupancyStatus.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus getOccupancyStatus() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus result = com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus.valueOf(occupancyStatus_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus.EMPTY : result;
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.OccupancyStatus occupancy_status = 9;</code>
+ * @param value The occupancyStatus to set.
+ * @return This builder for chaining.
+ */
+ public Builder setOccupancyStatus(com.google.transit.realtime.GtfsRealtime.VehiclePosition.OccupancyStatus value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000100;
+ occupancyStatus_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.VehiclePosition.OccupancyStatus occupancy_status = 9;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearOccupancyStatus() {
+ bitField0_ = (bitField0_ & ~0x00000100);
+ occupancyStatus_ = 0;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.VehiclePosition)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.VehiclePosition)
+ private static final com.google.transit.realtime.GtfsRealtime.VehiclePosition DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.VehiclePosition();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.VehiclePosition getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<VehiclePosition>
+ PARSER = new com.google.protobuf.AbstractParser<VehiclePosition>() {
+ @java.lang.Override
+ public VehiclePosition parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new VehiclePosition(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<VehiclePosition> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<VehiclePosition> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehiclePosition getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface AlertOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.Alert)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<Alert> {
+
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ java.util.List<com.google.transit.realtime.GtfsRealtime.TimeRange>
+ getActivePeriodList();
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TimeRange getActivePeriod(int index);
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ int getActivePeriodCount();
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ java.util.List<? extends com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder>
+ getActivePeriodOrBuilderList();
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder getActivePeriodOrBuilder(
+ int index);
+
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ java.util.List<com.google.transit.realtime.GtfsRealtime.EntitySelector>
+ getInformedEntityList();
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.EntitySelector getInformedEntity(int index);
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ int getInformedEntityCount();
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ java.util.List<? extends com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder>
+ getInformedEntityOrBuilderList();
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder getInformedEntityOrBuilder(
+ int index);
+
+ /**
+ * <code>optional .transit_realtime.Alert.Cause cause = 6 [default = UNKNOWN_CAUSE];</code>
+ * @return Whether the cause field is set.
+ */
+ boolean hasCause();
+ /**
+ * <code>optional .transit_realtime.Alert.Cause cause = 6 [default = UNKNOWN_CAUSE];</code>
+ * @return The cause.
+ */
+ com.google.transit.realtime.GtfsRealtime.Alert.Cause getCause();
+
+ /**
+ * <code>optional .transit_realtime.Alert.Effect effect = 7 [default = UNKNOWN_EFFECT];</code>
+ * @return Whether the effect field is set.
+ */
+ boolean hasEffect();
+ /**
+ * <code>optional .transit_realtime.Alert.Effect effect = 7 [default = UNKNOWN_EFFECT];</code>
+ * @return The effect.
+ */
+ com.google.transit.realtime.GtfsRealtime.Alert.Effect getEffect();
+
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ * @return Whether the url field is set.
+ */
+ boolean hasUrl();
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ * @return The url.
+ */
+ com.google.transit.realtime.GtfsRealtime.TranslatedString getUrl();
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder getUrlOrBuilder();
+
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ * @return Whether the headerText field is set.
+ */
+ boolean hasHeaderText();
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ * @return The headerText.
+ */
+ com.google.transit.realtime.GtfsRealtime.TranslatedString getHeaderText();
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder getHeaderTextOrBuilder();
+
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ * @return Whether the descriptionText field is set.
+ */
+ boolean hasDescriptionText();
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ * @return The descriptionText.
+ */
+ com.google.transit.realtime.GtfsRealtime.TranslatedString getDescriptionText();
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder getDescriptionTextOrBuilder();
+ }
+ /**
+ * <pre>
+ * An alert, indicating some sort of incident in the public transit network.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.Alert}
+ */
+ public static final class Alert extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ Alert> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.Alert)
+ AlertOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Alert.newBuilder() to construct.
+ private Alert(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.Alert, ?> builder) {
+ super(builder);
+ }
+ private Alert() {
+ activePeriod_ = java.util.Collections.emptyList();
+ informedEntity_ = java.util.Collections.emptyList();
+ cause_ = 1;
+ effect_ = 8;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new Alert();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Alert(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ if (!((mutable_bitField0_ & 0x00000001) != 0)) {
+ activePeriod_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.TimeRange>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ activePeriod_.add(
+ input.readMessage(com.google.transit.realtime.GtfsRealtime.TimeRange.PARSER, extensionRegistry));
+ break;
+ }
+ case 42: {
+ if (!((mutable_bitField0_ & 0x00000002) != 0)) {
+ informedEntity_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.EntitySelector>();
+ mutable_bitField0_ |= 0x00000002;
+ }
+ informedEntity_.add(
+ input.readMessage(com.google.transit.realtime.GtfsRealtime.EntitySelector.PARSER, extensionRegistry));
+ break;
+ }
+ case 48: {
+ int rawValue = input.readEnum();
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.Alert.Cause value = com.google.transit.realtime.GtfsRealtime.Alert.Cause.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(6, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ cause_ = rawValue;
+ }
+ break;
+ }
+ case 56: {
+ int rawValue = input.readEnum();
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.Alert.Effect value = com.google.transit.realtime.GtfsRealtime.Alert.Effect.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(7, rawValue);
+ } else {
+ bitField0_ |= 0x00000002;
+ effect_ = rawValue;
+ }
+ break;
+ }
+ case 66: {
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) != 0)) {
+ subBuilder = url_.toBuilder();
+ }
+ url_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.TranslatedString.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(url_);
+ url_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 82: {
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) != 0)) {
+ subBuilder = headerText_.toBuilder();
+ }
+ headerText_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.TranslatedString.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(headerText_);
+ headerText_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 90: {
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) != 0)) {
+ subBuilder = descriptionText_.toBuilder();
+ }
+ descriptionText_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.TranslatedString.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(descriptionText_);
+ descriptionText_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000001) != 0)) {
+ activePeriod_ = java.util.Collections.unmodifiableList(activePeriod_);
+ }
+ if (((mutable_bitField0_ & 0x00000002) != 0)) {
+ informedEntity_ = java.util.Collections.unmodifiableList(informedEntity_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Alert_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Alert_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.Alert.class, com.google.transit.realtime.GtfsRealtime.Alert.Builder.class);
+ }
+
+ /**
+ * <pre>
+ * Cause of this alert.
+ * </pre>
+ *
+ * Protobuf enum {@code transit_realtime.Alert.Cause}
+ */
+ public enum Cause
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN_CAUSE = 1;</code>
+ */
+ UNKNOWN_CAUSE(1),
+ /**
+ * <pre>
+ * Not machine-representable.
+ * </pre>
+ *
+ * <code>OTHER_CAUSE = 2;</code>
+ */
+ OTHER_CAUSE(2),
+ /**
+ * <code>TECHNICAL_PROBLEM = 3;</code>
+ */
+ TECHNICAL_PROBLEM(3),
+ /**
+ * <pre>
+ * Public transit agency employees stopped working.
+ * </pre>
+ *
+ * <code>STRIKE = 4;</code>
+ */
+ STRIKE(4),
+ /**
+ * <pre>
+ * People are blocking the streets.
+ * </pre>
+ *
+ * <code>DEMONSTRATION = 5;</code>
+ */
+ DEMONSTRATION(5),
+ /**
+ * <code>ACCIDENT = 6;</code>
+ */
+ ACCIDENT(6),
+ /**
+ * <code>HOLIDAY = 7;</code>
+ */
+ HOLIDAY(7),
+ /**
+ * <code>WEATHER = 8;</code>
+ */
+ WEATHER(8),
+ /**
+ * <code>MAINTENANCE = 9;</code>
+ */
+ MAINTENANCE(9),
+ /**
+ * <code>CONSTRUCTION = 10;</code>
+ */
+ CONSTRUCTION(10),
+ /**
+ * <code>POLICE_ACTIVITY = 11;</code>
+ */
+ POLICE_ACTIVITY(11),
+ /**
+ * <code>MEDICAL_EMERGENCY = 12;</code>
+ */
+ MEDICAL_EMERGENCY(12),
+ ;
+
+ /**
+ * <code>UNKNOWN_CAUSE = 1;</code>
+ */
+ public static final int UNKNOWN_CAUSE_VALUE = 1;
+ /**
+ * <pre>
+ * Not machine-representable.
+ * </pre>
+ *
+ * <code>OTHER_CAUSE = 2;</code>
+ */
+ public static final int OTHER_CAUSE_VALUE = 2;
+ /**
+ * <code>TECHNICAL_PROBLEM = 3;</code>
+ */
+ public static final int TECHNICAL_PROBLEM_VALUE = 3;
+ /**
+ * <pre>
+ * Public transit agency employees stopped working.
+ * </pre>
+ *
+ * <code>STRIKE = 4;</code>
+ */
+ public static final int STRIKE_VALUE = 4;
+ /**
+ * <pre>
+ * People are blocking the streets.
+ * </pre>
+ *
+ * <code>DEMONSTRATION = 5;</code>
+ */
+ public static final int DEMONSTRATION_VALUE = 5;
+ /**
+ * <code>ACCIDENT = 6;</code>
+ */
+ public static final int ACCIDENT_VALUE = 6;
+ /**
+ * <code>HOLIDAY = 7;</code>
+ */
+ public static final int HOLIDAY_VALUE = 7;
+ /**
+ * <code>WEATHER = 8;</code>
+ */
+ public static final int WEATHER_VALUE = 8;
+ /**
+ * <code>MAINTENANCE = 9;</code>
+ */
+ public static final int MAINTENANCE_VALUE = 9;
+ /**
+ * <code>CONSTRUCTION = 10;</code>
+ */
+ public static final int CONSTRUCTION_VALUE = 10;
+ /**
+ * <code>POLICE_ACTIVITY = 11;</code>
+ */
+ public static final int POLICE_ACTIVITY_VALUE = 11;
+ /**
+ * <code>MEDICAL_EMERGENCY = 12;</code>
+ */
+ public static final int MEDICAL_EMERGENCY_VALUE = 12;
+
+
+ public final int getNumber() {
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Cause valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Cause forNumber(int value) {
+ switch (value) {
+ case 1: return UNKNOWN_CAUSE;
+ case 2: return OTHER_CAUSE;
+ case 3: return TECHNICAL_PROBLEM;
+ case 4: return STRIKE;
+ case 5: return DEMONSTRATION;
+ case 6: return ACCIDENT;
+ case 7: return HOLIDAY;
+ case 8: return WEATHER;
+ case 9: return MAINTENANCE;
+ case 10: return CONSTRUCTION;
+ case 11: return POLICE_ACTIVITY;
+ case 12: return MEDICAL_EMERGENCY;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Cause>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ Cause> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Cause>() {
+ public Cause findValueByNumber(int number) {
+ return Cause.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.Alert.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Cause[] VALUES = values();
+
+ public static Cause valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private Cause(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:transit_realtime.Alert.Cause)
+ }
+
+ /**
+ * <pre>
+ * What is the effect of this problem on the affected entity.
+ * </pre>
+ *
+ * Protobuf enum {@code transit_realtime.Alert.Effect}
+ */
+ public enum Effect
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>NO_SERVICE = 1;</code>
+ */
+ NO_SERVICE(1),
+ /**
+ * <code>REDUCED_SERVICE = 2;</code>
+ */
+ REDUCED_SERVICE(2),
+ /**
+ * <pre>
+ * We don't care about INsignificant delays: they are hard to detect, have
+ * little impact on the user, and would clutter the results as they are too
+ * frequent.
+ * </pre>
+ *
+ * <code>SIGNIFICANT_DELAYS = 3;</code>
+ */
+ SIGNIFICANT_DELAYS(3),
+ /**
+ * <code>DETOUR = 4;</code>
+ */
+ DETOUR(4),
+ /**
+ * <code>ADDITIONAL_SERVICE = 5;</code>
+ */
+ ADDITIONAL_SERVICE(5),
+ /**
+ * <code>MODIFIED_SERVICE = 6;</code>
+ */
+ MODIFIED_SERVICE(6),
+ /**
+ * <code>OTHER_EFFECT = 7;</code>
+ */
+ OTHER_EFFECT(7),
+ /**
+ * <code>UNKNOWN_EFFECT = 8;</code>
+ */
+ UNKNOWN_EFFECT(8),
+ /**
+ * <code>STOP_MOVED = 9;</code>
+ */
+ STOP_MOVED(9),
+ ;
+
+ /**
+ * <code>NO_SERVICE = 1;</code>
+ */
+ public static final int NO_SERVICE_VALUE = 1;
+ /**
+ * <code>REDUCED_SERVICE = 2;</code>
+ */
+ public static final int REDUCED_SERVICE_VALUE = 2;
+ /**
+ * <pre>
+ * We don't care about INsignificant delays: they are hard to detect, have
+ * little impact on the user, and would clutter the results as they are too
+ * frequent.
+ * </pre>
+ *
+ * <code>SIGNIFICANT_DELAYS = 3;</code>
+ */
+ public static final int SIGNIFICANT_DELAYS_VALUE = 3;
+ /**
+ * <code>DETOUR = 4;</code>
+ */
+ public static final int DETOUR_VALUE = 4;
+ /**
+ * <code>ADDITIONAL_SERVICE = 5;</code>
+ */
+ public static final int ADDITIONAL_SERVICE_VALUE = 5;
+ /**
+ * <code>MODIFIED_SERVICE = 6;</code>
+ */
+ public static final int MODIFIED_SERVICE_VALUE = 6;
+ /**
+ * <code>OTHER_EFFECT = 7;</code>
+ */
+ public static final int OTHER_EFFECT_VALUE = 7;
+ /**
+ * <code>UNKNOWN_EFFECT = 8;</code>
+ */
+ public static final int UNKNOWN_EFFECT_VALUE = 8;
+ /**
+ * <code>STOP_MOVED = 9;</code>
+ */
+ public static final int STOP_MOVED_VALUE = 9;
+
+
+ public final int getNumber() {
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Effect valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static Effect forNumber(int value) {
+ switch (value) {
+ case 1: return NO_SERVICE;
+ case 2: return REDUCED_SERVICE;
+ case 3: return SIGNIFICANT_DELAYS;
+ case 4: return DETOUR;
+ case 5: return ADDITIONAL_SERVICE;
+ case 6: return MODIFIED_SERVICE;
+ case 7: return OTHER_EFFECT;
+ case 8: return UNKNOWN_EFFECT;
+ case 9: return STOP_MOVED;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Effect>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ Effect> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Effect>() {
+ public Effect findValueByNumber(int number) {
+ return Effect.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.Alert.getDescriptor().getEnumTypes().get(1);
+ }
+
+ private static final Effect[] VALUES = values();
+
+ public static Effect valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private Effect(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:transit_realtime.Alert.Effect)
+ }
+
+ private int bitField0_;
+ public static final int ACTIVE_PERIOD_FIELD_NUMBER = 1;
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.TimeRange> activePeriod_;
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ @java.lang.Override
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.TimeRange> getActivePeriodList() {
+ return activePeriod_;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ @java.lang.Override
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder>
+ getActivePeriodOrBuilderList() {
+ return activePeriod_;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ @java.lang.Override
+ public int getActivePeriodCount() {
+ return activePeriod_.size();
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TimeRange getActivePeriod(int index) {
+ return activePeriod_.get(index);
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder getActivePeriodOrBuilder(
+ int index) {
+ return activePeriod_.get(index);
+ }
+
+ public static final int INFORMED_ENTITY_FIELD_NUMBER = 5;
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.EntitySelector> informedEntity_;
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ @java.lang.Override
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.EntitySelector> getInformedEntityList() {
+ return informedEntity_;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ @java.lang.Override
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder>
+ getInformedEntityOrBuilderList() {
+ return informedEntity_;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ @java.lang.Override
+ public int getInformedEntityCount() {
+ return informedEntity_.size();
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.EntitySelector getInformedEntity(int index) {
+ return informedEntity_.get(index);
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder getInformedEntityOrBuilder(
+ int index) {
+ return informedEntity_.get(index);
+ }
+
+ public static final int CAUSE_FIELD_NUMBER = 6;
+ private int cause_;
+ /**
+ * <code>optional .transit_realtime.Alert.Cause cause = 6 [default = UNKNOWN_CAUSE];</code>
+ * @return Whether the cause field is set.
+ */
+ @java.lang.Override public boolean hasCause() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.Alert.Cause cause = 6 [default = UNKNOWN_CAUSE];</code>
+ * @return The cause.
+ */
+ @java.lang.Override public com.google.transit.realtime.GtfsRealtime.Alert.Cause getCause() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.Alert.Cause result = com.google.transit.realtime.GtfsRealtime.Alert.Cause.valueOf(cause_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.Alert.Cause.UNKNOWN_CAUSE : result;
+ }
+
+ public static final int EFFECT_FIELD_NUMBER = 7;
+ private int effect_;
+ /**
+ * <code>optional .transit_realtime.Alert.Effect effect = 7 [default = UNKNOWN_EFFECT];</code>
+ * @return Whether the effect field is set.
+ */
+ @java.lang.Override public boolean hasEffect() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.Alert.Effect effect = 7 [default = UNKNOWN_EFFECT];</code>
+ * @return The effect.
+ */
+ @java.lang.Override public com.google.transit.realtime.GtfsRealtime.Alert.Effect getEffect() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.Alert.Effect result = com.google.transit.realtime.GtfsRealtime.Alert.Effect.valueOf(effect_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.Alert.Effect.UNKNOWN_EFFECT : result;
+ }
+
+ public static final int URL_FIELD_NUMBER = 8;
+ private com.google.transit.realtime.GtfsRealtime.TranslatedString url_;
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ * @return Whether the url field is set.
+ */
+ @java.lang.Override
+ public boolean hasUrl() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ * @return The url.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString getUrl() {
+ return url_ == null ? com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : url_;
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder getUrlOrBuilder() {
+ return url_ == null ? com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : url_;
+ }
+
+ public static final int HEADER_TEXT_FIELD_NUMBER = 10;
+ private com.google.transit.realtime.GtfsRealtime.TranslatedString headerText_;
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ * @return Whether the headerText field is set.
+ */
+ @java.lang.Override
+ public boolean hasHeaderText() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ * @return The headerText.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString getHeaderText() {
+ return headerText_ == null ? com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : headerText_;
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder getHeaderTextOrBuilder() {
+ return headerText_ == null ? com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : headerText_;
+ }
+
+ public static final int DESCRIPTION_TEXT_FIELD_NUMBER = 11;
+ private com.google.transit.realtime.GtfsRealtime.TranslatedString descriptionText_;
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ * @return Whether the descriptionText field is set.
+ */
+ @java.lang.Override
+ public boolean hasDescriptionText() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ * @return The descriptionText.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString getDescriptionText() {
+ return descriptionText_ == null ? com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : descriptionText_;
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder getDescriptionTextOrBuilder() {
+ return descriptionText_ == null ? com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : descriptionText_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ for (int i = 0; i < getActivePeriodCount(); i++) {
+ if (!getActivePeriod(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ for (int i = 0; i < getInformedEntityCount(); i++) {
+ if (!getInformedEntity(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasUrl()) {
+ if (!getUrl().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasHeaderText()) {
+ if (!getHeaderText().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasDescriptionText()) {
+ if (!getDescriptionText().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.Alert>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ for (int i = 0; i < activePeriod_.size(); i++) {
+ output.writeMessage(1, activePeriod_.get(i));
+ }
+ for (int i = 0; i < informedEntity_.size(); i++) {
+ output.writeMessage(5, informedEntity_.get(i));
+ }
+ if (((bitField0_ & 0x00000001) != 0)) {
+ output.writeEnum(6, cause_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ output.writeEnum(7, effect_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeMessage(8, getUrl());
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ output.writeMessage(10, getHeaderText());
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ output.writeMessage(11, getDescriptionText());
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < activePeriod_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, activePeriod_.get(i));
+ }
+ for (int i = 0; i < informedEntity_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(5, informedEntity_.get(i));
+ }
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(6, cause_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(7, effect_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(8, getUrl());
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(10, getHeaderText());
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(11, getDescriptionText());
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.Alert)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.Alert other = (com.google.transit.realtime.GtfsRealtime.Alert) obj;
+
+ if (!getActivePeriodList()
+ .equals(other.getActivePeriodList())) return false;
+ if (!getInformedEntityList()
+ .equals(other.getInformedEntityList())) return false;
+ if (hasCause() != other.hasCause()) return false;
+ if (hasCause()) {
+ if (cause_ != other.cause_) return false;
+ }
+ if (hasEffect() != other.hasEffect()) return false;
+ if (hasEffect()) {
+ if (effect_ != other.effect_) return false;
+ }
+ if (hasUrl() != other.hasUrl()) return false;
+ if (hasUrl()) {
+ if (!getUrl()
+ .equals(other.getUrl())) return false;
+ }
+ if (hasHeaderText() != other.hasHeaderText()) return false;
+ if (hasHeaderText()) {
+ if (!getHeaderText()
+ .equals(other.getHeaderText())) return false;
+ }
+ if (hasDescriptionText() != other.hasDescriptionText()) return false;
+ if (hasDescriptionText()) {
+ if (!getDescriptionText()
+ .equals(other.getDescriptionText())) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (getActivePeriodCount() > 0) {
+ hash = (37 * hash) + ACTIVE_PERIOD_FIELD_NUMBER;
+ hash = (53 * hash) + getActivePeriodList().hashCode();
+ }
+ if (getInformedEntityCount() > 0) {
+ hash = (37 * hash) + INFORMED_ENTITY_FIELD_NUMBER;
+ hash = (53 * hash) + getInformedEntityList().hashCode();
+ }
+ if (hasCause()) {
+ hash = (37 * hash) + CAUSE_FIELD_NUMBER;
+ hash = (53 * hash) + cause_;
+ }
+ if (hasEffect()) {
+ hash = (37 * hash) + EFFECT_FIELD_NUMBER;
+ hash = (53 * hash) + effect_;
+ }
+ if (hasUrl()) {
+ hash = (37 * hash) + URL_FIELD_NUMBER;
+ hash = (53 * hash) + getUrl().hashCode();
+ }
+ if (hasHeaderText()) {
+ hash = (37 * hash) + HEADER_TEXT_FIELD_NUMBER;
+ hash = (53 * hash) + getHeaderText().hashCode();
+ }
+ if (hasDescriptionText()) {
+ hash = (37 * hash) + DESCRIPTION_TEXT_FIELD_NUMBER;
+ hash = (53 * hash) + getDescriptionText().hashCode();
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Alert parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.Alert prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * An alert, indicating some sort of incident in the public transit network.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.Alert}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.Alert, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.Alert)
+ com.google.transit.realtime.GtfsRealtime.AlertOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Alert_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Alert_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.Alert.class, com.google.transit.realtime.GtfsRealtime.Alert.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.Alert.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ getActivePeriodFieldBuilder();
+ getInformedEntityFieldBuilder();
+ getUrlFieldBuilder();
+ getHeaderTextFieldBuilder();
+ getDescriptionTextFieldBuilder();
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ if (activePeriodBuilder_ == null) {
+ activePeriod_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ activePeriodBuilder_.clear();
+ }
+ if (informedEntityBuilder_ == null) {
+ informedEntity_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ } else {
+ informedEntityBuilder_.clear();
+ }
+ cause_ = 1;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ effect_ = 8;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ if (urlBuilder_ == null) {
+ url_ = null;
+ } else {
+ urlBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000010);
+ if (headerTextBuilder_ == null) {
+ headerText_ = null;
+ } else {
+ headerTextBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000020);
+ if (descriptionTextBuilder_ == null) {
+ descriptionText_ = null;
+ } else {
+ descriptionTextBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000040);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Alert_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Alert getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.Alert.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Alert build() {
+ com.google.transit.realtime.GtfsRealtime.Alert result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Alert buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.Alert result = new com.google.transit.realtime.GtfsRealtime.Alert(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (activePeriodBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) != 0)) {
+ activePeriod_ = java.util.Collections.unmodifiableList(activePeriod_);
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.activePeriod_ = activePeriod_;
+ } else {
+ result.activePeriod_ = activePeriodBuilder_.build();
+ }
+ if (informedEntityBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) != 0)) {
+ informedEntity_ = java.util.Collections.unmodifiableList(informedEntity_);
+ bitField0_ = (bitField0_ & ~0x00000002);
+ }
+ result.informedEntity_ = informedEntity_;
+ } else {
+ result.informedEntity_ = informedEntityBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.cause_ = cause_;
+ if (((from_bitField0_ & 0x00000008) != 0)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.effect_ = effect_;
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ if (urlBuilder_ == null) {
+ result.url_ = url_;
+ } else {
+ result.url_ = urlBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000004;
+ }
+ if (((from_bitField0_ & 0x00000020) != 0)) {
+ if (headerTextBuilder_ == null) {
+ result.headerText_ = headerText_;
+ } else {
+ result.headerText_ = headerTextBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000008;
+ }
+ if (((from_bitField0_ & 0x00000040) != 0)) {
+ if (descriptionTextBuilder_ == null) {
+ result.descriptionText_ = descriptionText_;
+ } else {
+ result.descriptionText_ = descriptionTextBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000010;
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.Alert, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.Alert, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.Alert, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.Alert, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.Alert) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.Alert)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.Alert other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.Alert.getDefaultInstance()) return this;
+ if (activePeriodBuilder_ == null) {
+ if (!other.activePeriod_.isEmpty()) {
+ if (activePeriod_.isEmpty()) {
+ activePeriod_ = other.activePeriod_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureActivePeriodIsMutable();
+ activePeriod_.addAll(other.activePeriod_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.activePeriod_.isEmpty()) {
+ if (activePeriodBuilder_.isEmpty()) {
+ activePeriodBuilder_.dispose();
+ activePeriodBuilder_ = null;
+ activePeriod_ = other.activePeriod_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ activePeriodBuilder_ =
+ com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
+ getActivePeriodFieldBuilder() : null;
+ } else {
+ activePeriodBuilder_.addAllMessages(other.activePeriod_);
+ }
+ }
+ }
+ if (informedEntityBuilder_ == null) {
+ if (!other.informedEntity_.isEmpty()) {
+ if (informedEntity_.isEmpty()) {
+ informedEntity_ = other.informedEntity_;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ } else {
+ ensureInformedEntityIsMutable();
+ informedEntity_.addAll(other.informedEntity_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.informedEntity_.isEmpty()) {
+ if (informedEntityBuilder_.isEmpty()) {
+ informedEntityBuilder_.dispose();
+ informedEntityBuilder_ = null;
+ informedEntity_ = other.informedEntity_;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ informedEntityBuilder_ =
+ com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
+ getInformedEntityFieldBuilder() : null;
+ } else {
+ informedEntityBuilder_.addAllMessages(other.informedEntity_);
+ }
+ }
+ }
+ if (other.hasCause()) {
+ setCause(other.getCause());
+ }
+ if (other.hasEffect()) {
+ setEffect(other.getEffect());
+ }
+ if (other.hasUrl()) {
+ mergeUrl(other.getUrl());
+ }
+ if (other.hasHeaderText()) {
+ mergeHeaderText(other.getHeaderText());
+ }
+ if (other.hasDescriptionText()) {
+ mergeDescriptionText(other.getDescriptionText());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ for (int i = 0; i < getActivePeriodCount(); i++) {
+ if (!getActivePeriod(i).isInitialized()) {
+ return false;
+ }
+ }
+ for (int i = 0; i < getInformedEntityCount(); i++) {
+ if (!getInformedEntity(i).isInitialized()) {
+ return false;
+ }
+ }
+ if (hasUrl()) {
+ if (!getUrl().isInitialized()) {
+ return false;
+ }
+ }
+ if (hasHeaderText()) {
+ if (!getHeaderText().isInitialized()) {
+ return false;
+ }
+ }
+ if (hasDescriptionText()) {
+ if (!getDescriptionText().isInitialized()) {
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.Alert parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.Alert) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.TimeRange> activePeriod_ =
+ java.util.Collections.emptyList();
+ private void ensureActivePeriodIsMutable() {
+ if (!((bitField0_ & 0x00000001) != 0)) {
+ activePeriod_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.TimeRange>(activePeriod_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TimeRange, com.google.transit.realtime.GtfsRealtime.TimeRange.Builder, com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder> activePeriodBuilder_;
+
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.TimeRange> getActivePeriodList() {
+ if (activePeriodBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(activePeriod_);
+ } else {
+ return activePeriodBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public int getActivePeriodCount() {
+ if (activePeriodBuilder_ == null) {
+ return activePeriod_.size();
+ } else {
+ return activePeriodBuilder_.getCount();
+ }
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TimeRange getActivePeriod(int index) {
+ if (activePeriodBuilder_ == null) {
+ return activePeriod_.get(index);
+ } else {
+ return activePeriodBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public Builder setActivePeriod(
+ int index, com.google.transit.realtime.GtfsRealtime.TimeRange value) {
+ if (activePeriodBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureActivePeriodIsMutable();
+ activePeriod_.set(index, value);
+ onChanged();
+ } else {
+ activePeriodBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public Builder setActivePeriod(
+ int index, com.google.transit.realtime.GtfsRealtime.TimeRange.Builder builderForValue) {
+ if (activePeriodBuilder_ == null) {
+ ensureActivePeriodIsMutable();
+ activePeriod_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ activePeriodBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public Builder addActivePeriod(com.google.transit.realtime.GtfsRealtime.TimeRange value) {
+ if (activePeriodBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureActivePeriodIsMutable();
+ activePeriod_.add(value);
+ onChanged();
+ } else {
+ activePeriodBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public Builder addActivePeriod(
+ int index, com.google.transit.realtime.GtfsRealtime.TimeRange value) {
+ if (activePeriodBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureActivePeriodIsMutable();
+ activePeriod_.add(index, value);
+ onChanged();
+ } else {
+ activePeriodBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public Builder addActivePeriod(
+ com.google.transit.realtime.GtfsRealtime.TimeRange.Builder builderForValue) {
+ if (activePeriodBuilder_ == null) {
+ ensureActivePeriodIsMutable();
+ activePeriod_.add(builderForValue.build());
+ onChanged();
+ } else {
+ activePeriodBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public Builder addActivePeriod(
+ int index, com.google.transit.realtime.GtfsRealtime.TimeRange.Builder builderForValue) {
+ if (activePeriodBuilder_ == null) {
+ ensureActivePeriodIsMutable();
+ activePeriod_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ activePeriodBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public Builder addAllActivePeriod(
+ java.lang.Iterable<? extends com.google.transit.realtime.GtfsRealtime.TimeRange> values) {
+ if (activePeriodBuilder_ == null) {
+ ensureActivePeriodIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, activePeriod_);
+ onChanged();
+ } else {
+ activePeriodBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public Builder clearActivePeriod() {
+ if (activePeriodBuilder_ == null) {
+ activePeriod_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ activePeriodBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public Builder removeActivePeriod(int index) {
+ if (activePeriodBuilder_ == null) {
+ ensureActivePeriodIsMutable();
+ activePeriod_.remove(index);
+ onChanged();
+ } else {
+ activePeriodBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TimeRange.Builder getActivePeriodBuilder(
+ int index) {
+ return getActivePeriodFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder getActivePeriodOrBuilder(
+ int index) {
+ if (activePeriodBuilder_ == null) {
+ return activePeriod_.get(index); } else {
+ return activePeriodBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder>
+ getActivePeriodOrBuilderList() {
+ if (activePeriodBuilder_ != null) {
+ return activePeriodBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(activePeriod_);
+ }
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TimeRange.Builder addActivePeriodBuilder() {
+ return getActivePeriodFieldBuilder().addBuilder(
+ com.google.transit.realtime.GtfsRealtime.TimeRange.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TimeRange.Builder addActivePeriodBuilder(
+ int index) {
+ return getActivePeriodFieldBuilder().addBuilder(
+ index, com.google.transit.realtime.GtfsRealtime.TimeRange.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * Time when the alert should be shown to the user. If missing, the
+ * alert will be shown as long as it appears in the feed.
+ * If multiple ranges are given, the alert will be shown during all of them.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TimeRange active_period = 1;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.TimeRange.Builder>
+ getActivePeriodBuilderList() {
+ return getActivePeriodFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TimeRange, com.google.transit.realtime.GtfsRealtime.TimeRange.Builder, com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder>
+ getActivePeriodFieldBuilder() {
+ if (activePeriodBuilder_ == null) {
+ activePeriodBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TimeRange, com.google.transit.realtime.GtfsRealtime.TimeRange.Builder, com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder>(
+ activePeriod_,
+ ((bitField0_ & 0x00000001) != 0),
+ getParentForChildren(),
+ isClean());
+ activePeriod_ = null;
+ }
+ return activePeriodBuilder_;
+ }
+
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.EntitySelector> informedEntity_ =
+ java.util.Collections.emptyList();
+ private void ensureInformedEntityIsMutable() {
+ if (!((bitField0_ & 0x00000002) != 0)) {
+ informedEntity_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.EntitySelector>(informedEntity_);
+ bitField0_ |= 0x00000002;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.EntitySelector, com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder, com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder> informedEntityBuilder_;
+
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.EntitySelector> getInformedEntityList() {
+ if (informedEntityBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(informedEntity_);
+ } else {
+ return informedEntityBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public int getInformedEntityCount() {
+ if (informedEntityBuilder_ == null) {
+ return informedEntity_.size();
+ } else {
+ return informedEntityBuilder_.getCount();
+ }
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.EntitySelector getInformedEntity(int index) {
+ if (informedEntityBuilder_ == null) {
+ return informedEntity_.get(index);
+ } else {
+ return informedEntityBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public Builder setInformedEntity(
+ int index, com.google.transit.realtime.GtfsRealtime.EntitySelector value) {
+ if (informedEntityBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInformedEntityIsMutable();
+ informedEntity_.set(index, value);
+ onChanged();
+ } else {
+ informedEntityBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public Builder setInformedEntity(
+ int index, com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder builderForValue) {
+ if (informedEntityBuilder_ == null) {
+ ensureInformedEntityIsMutable();
+ informedEntity_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ informedEntityBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public Builder addInformedEntity(com.google.transit.realtime.GtfsRealtime.EntitySelector value) {
+ if (informedEntityBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInformedEntityIsMutable();
+ informedEntity_.add(value);
+ onChanged();
+ } else {
+ informedEntityBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public Builder addInformedEntity(
+ int index, com.google.transit.realtime.GtfsRealtime.EntitySelector value) {
+ if (informedEntityBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureInformedEntityIsMutable();
+ informedEntity_.add(index, value);
+ onChanged();
+ } else {
+ informedEntityBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public Builder addInformedEntity(
+ com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder builderForValue) {
+ if (informedEntityBuilder_ == null) {
+ ensureInformedEntityIsMutable();
+ informedEntity_.add(builderForValue.build());
+ onChanged();
+ } else {
+ informedEntityBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public Builder addInformedEntity(
+ int index, com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder builderForValue) {
+ if (informedEntityBuilder_ == null) {
+ ensureInformedEntityIsMutable();
+ informedEntity_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ informedEntityBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public Builder addAllInformedEntity(
+ java.lang.Iterable<? extends com.google.transit.realtime.GtfsRealtime.EntitySelector> values) {
+ if (informedEntityBuilder_ == null) {
+ ensureInformedEntityIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, informedEntity_);
+ onChanged();
+ } else {
+ informedEntityBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public Builder clearInformedEntity() {
+ if (informedEntityBuilder_ == null) {
+ informedEntity_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ } else {
+ informedEntityBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public Builder removeInformedEntity(int index) {
+ if (informedEntityBuilder_ == null) {
+ ensureInformedEntityIsMutable();
+ informedEntity_.remove(index);
+ onChanged();
+ } else {
+ informedEntityBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder getInformedEntityBuilder(
+ int index) {
+ return getInformedEntityFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder getInformedEntityOrBuilder(
+ int index) {
+ if (informedEntityBuilder_ == null) {
+ return informedEntity_.get(index); } else {
+ return informedEntityBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder>
+ getInformedEntityOrBuilderList() {
+ if (informedEntityBuilder_ != null) {
+ return informedEntityBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(informedEntity_);
+ }
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder addInformedEntityBuilder() {
+ return getInformedEntityFieldBuilder().addBuilder(
+ com.google.transit.realtime.GtfsRealtime.EntitySelector.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder addInformedEntityBuilder(
+ int index) {
+ return getInformedEntityFieldBuilder().addBuilder(
+ index, com.google.transit.realtime.GtfsRealtime.EntitySelector.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * Entities whose users we should notify of this alert.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.EntitySelector informed_entity = 5;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder>
+ getInformedEntityBuilderList() {
+ return getInformedEntityFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.EntitySelector, com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder, com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder>
+ getInformedEntityFieldBuilder() {
+ if (informedEntityBuilder_ == null) {
+ informedEntityBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.EntitySelector, com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder, com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder>(
+ informedEntity_,
+ ((bitField0_ & 0x00000002) != 0),
+ getParentForChildren(),
+ isClean());
+ informedEntity_ = null;
+ }
+ return informedEntityBuilder_;
+ }
+
+ private int cause_ = 1;
+ /**
+ * <code>optional .transit_realtime.Alert.Cause cause = 6 [default = UNKNOWN_CAUSE];</code>
+ * @return Whether the cause field is set.
+ */
+ @java.lang.Override public boolean hasCause() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.Alert.Cause cause = 6 [default = UNKNOWN_CAUSE];</code>
+ * @return The cause.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Alert.Cause getCause() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.Alert.Cause result = com.google.transit.realtime.GtfsRealtime.Alert.Cause.valueOf(cause_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.Alert.Cause.UNKNOWN_CAUSE : result;
+ }
+ /**
+ * <code>optional .transit_realtime.Alert.Cause cause = 6 [default = UNKNOWN_CAUSE];</code>
+ * @param value The cause to set.
+ * @return This builder for chaining.
+ */
+ public Builder setCause(com.google.transit.realtime.GtfsRealtime.Alert.Cause value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ cause_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.Alert.Cause cause = 6 [default = UNKNOWN_CAUSE];</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearCause() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ cause_ = 1;
+ onChanged();
+ return this;
+ }
+
+ private int effect_ = 8;
+ /**
+ * <code>optional .transit_realtime.Alert.Effect effect = 7 [default = UNKNOWN_EFFECT];</code>
+ * @return Whether the effect field is set.
+ */
+ @java.lang.Override public boolean hasEffect() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.Alert.Effect effect = 7 [default = UNKNOWN_EFFECT];</code>
+ * @return The effect.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Alert.Effect getEffect() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.Alert.Effect result = com.google.transit.realtime.GtfsRealtime.Alert.Effect.valueOf(effect_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.Alert.Effect.UNKNOWN_EFFECT : result;
+ }
+ /**
+ * <code>optional .transit_realtime.Alert.Effect effect = 7 [default = UNKNOWN_EFFECT];</code>
+ * @param value The effect to set.
+ * @return This builder for chaining.
+ */
+ public Builder setEffect(com.google.transit.realtime.GtfsRealtime.Alert.Effect value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000008;
+ effect_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.Alert.Effect effect = 7 [default = UNKNOWN_EFFECT];</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearEffect() {
+ bitField0_ = (bitField0_ & ~0x00000008);
+ effect_ = 8;
+ onChanged();
+ return this;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.TranslatedString url_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder> urlBuilder_;
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ * @return Whether the url field is set.
+ */
+ public boolean hasUrl() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ * @return The url.
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString getUrl() {
+ if (urlBuilder_ == null) {
+ return url_ == null ? com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : url_;
+ } else {
+ return urlBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ */
+ public Builder setUrl(com.google.transit.realtime.GtfsRealtime.TranslatedString value) {
+ if (urlBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ url_ = value;
+ onChanged();
+ } else {
+ urlBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ */
+ public Builder setUrl(
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder builderForValue) {
+ if (urlBuilder_ == null) {
+ url_ = builderForValue.build();
+ onChanged();
+ } else {
+ urlBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ */
+ public Builder mergeUrl(com.google.transit.realtime.GtfsRealtime.TranslatedString value) {
+ if (urlBuilder_ == null) {
+ if (((bitField0_ & 0x00000010) != 0) &&
+ url_ != null &&
+ url_ != com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance()) {
+ url_ =
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.newBuilder(url_).mergeFrom(value).buildPartial();
+ } else {
+ url_ = value;
+ }
+ onChanged();
+ } else {
+ urlBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ */
+ public Builder clearUrl() {
+ if (urlBuilder_ == null) {
+ url_ = null;
+ onChanged();
+ } else {
+ urlBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000010);
+ return this;
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder getUrlBuilder() {
+ bitField0_ |= 0x00000010;
+ onChanged();
+ return getUrlFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder getUrlOrBuilder() {
+ if (urlBuilder_ != null) {
+ return urlBuilder_.getMessageOrBuilder();
+ } else {
+ return url_ == null ?
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : url_;
+ }
+ }
+ /**
+ * <pre>
+ * The URL which provides additional information about the alert.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString url = 8;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder>
+ getUrlFieldBuilder() {
+ if (urlBuilder_ == null) {
+ urlBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder>(
+ getUrl(),
+ getParentForChildren(),
+ isClean());
+ url_ = null;
+ }
+ return urlBuilder_;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.TranslatedString headerText_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder> headerTextBuilder_;
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ * @return Whether the headerText field is set.
+ */
+ public boolean hasHeaderText() {
+ return ((bitField0_ & 0x00000020) != 0);
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ * @return The headerText.
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString getHeaderText() {
+ if (headerTextBuilder_ == null) {
+ return headerText_ == null ? com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : headerText_;
+ } else {
+ return headerTextBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ */
+ public Builder setHeaderText(com.google.transit.realtime.GtfsRealtime.TranslatedString value) {
+ if (headerTextBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ headerText_ = value;
+ onChanged();
+ } else {
+ headerTextBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000020;
+ return this;
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ */
+ public Builder setHeaderText(
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder builderForValue) {
+ if (headerTextBuilder_ == null) {
+ headerText_ = builderForValue.build();
+ onChanged();
+ } else {
+ headerTextBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000020;
+ return this;
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ */
+ public Builder mergeHeaderText(com.google.transit.realtime.GtfsRealtime.TranslatedString value) {
+ if (headerTextBuilder_ == null) {
+ if (((bitField0_ & 0x00000020) != 0) &&
+ headerText_ != null &&
+ headerText_ != com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance()) {
+ headerText_ =
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.newBuilder(headerText_).mergeFrom(value).buildPartial();
+ } else {
+ headerText_ = value;
+ }
+ onChanged();
+ } else {
+ headerTextBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000020;
+ return this;
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ */
+ public Builder clearHeaderText() {
+ if (headerTextBuilder_ == null) {
+ headerText_ = null;
+ onChanged();
+ } else {
+ headerTextBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000020);
+ return this;
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder getHeaderTextBuilder() {
+ bitField0_ |= 0x00000020;
+ onChanged();
+ return getHeaderTextFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder getHeaderTextOrBuilder() {
+ if (headerTextBuilder_ != null) {
+ return headerTextBuilder_.getMessageOrBuilder();
+ } else {
+ return headerText_ == null ?
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : headerText_;
+ }
+ }
+ /**
+ * <pre>
+ * Alert header. Contains a short summary of the alert text as plain-text.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString header_text = 10;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder>
+ getHeaderTextFieldBuilder() {
+ if (headerTextBuilder_ == null) {
+ headerTextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder>(
+ getHeaderText(),
+ getParentForChildren(),
+ isClean());
+ headerText_ = null;
+ }
+ return headerTextBuilder_;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.TranslatedString descriptionText_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder> descriptionTextBuilder_;
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ * @return Whether the descriptionText field is set.
+ */
+ public boolean hasDescriptionText() {
+ return ((bitField0_ & 0x00000040) != 0);
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ * @return The descriptionText.
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString getDescriptionText() {
+ if (descriptionTextBuilder_ == null) {
+ return descriptionText_ == null ? com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : descriptionText_;
+ } else {
+ return descriptionTextBuilder_.getMessage();
+ }
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ */
+ public Builder setDescriptionText(com.google.transit.realtime.GtfsRealtime.TranslatedString value) {
+ if (descriptionTextBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ descriptionText_ = value;
+ onChanged();
+ } else {
+ descriptionTextBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000040;
+ return this;
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ */
+ public Builder setDescriptionText(
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder builderForValue) {
+ if (descriptionTextBuilder_ == null) {
+ descriptionText_ = builderForValue.build();
+ onChanged();
+ } else {
+ descriptionTextBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000040;
+ return this;
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ */
+ public Builder mergeDescriptionText(com.google.transit.realtime.GtfsRealtime.TranslatedString value) {
+ if (descriptionTextBuilder_ == null) {
+ if (((bitField0_ & 0x00000040) != 0) &&
+ descriptionText_ != null &&
+ descriptionText_ != com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance()) {
+ descriptionText_ =
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.newBuilder(descriptionText_).mergeFrom(value).buildPartial();
+ } else {
+ descriptionText_ = value;
+ }
+ onChanged();
+ } else {
+ descriptionTextBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000040;
+ return this;
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ */
+ public Builder clearDescriptionText() {
+ if (descriptionTextBuilder_ == null) {
+ descriptionText_ = null;
+ onChanged();
+ } else {
+ descriptionTextBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000040);
+ return this;
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder getDescriptionTextBuilder() {
+ bitField0_ |= 0x00000040;
+ onChanged();
+ return getDescriptionTextFieldBuilder().getBuilder();
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder getDescriptionTextOrBuilder() {
+ if (descriptionTextBuilder_ != null) {
+ return descriptionTextBuilder_.getMessageOrBuilder();
+ } else {
+ return descriptionText_ == null ?
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance() : descriptionText_;
+ }
+ }
+ /**
+ * <pre>
+ * Full description for the alert as plain-text. The information in the
+ * description should add to the information of the header.
+ * </pre>
+ *
+ * <code>optional .transit_realtime.TranslatedString description_text = 11;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder>
+ getDescriptionTextFieldBuilder() {
+ if (descriptionTextBuilder_ == null) {
+ descriptionTextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder>(
+ getDescriptionText(),
+ getParentForChildren(),
+ isClean());
+ descriptionText_ = null;
+ }
+ return descriptionTextBuilder_;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.Alert)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.Alert)
+ private static final com.google.transit.realtime.GtfsRealtime.Alert DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.Alert();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.Alert getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<Alert>
+ PARSER = new com.google.protobuf.AbstractParser<Alert>() {
+ @java.lang.Override
+ public Alert parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Alert(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<Alert> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Alert> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Alert getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface TimeRangeOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.TimeRange)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<TimeRange> {
+
+ /**
+ * <pre>
+ * Start time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval starts at minus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 start = 1;</code>
+ * @return Whether the start field is set.
+ */
+ boolean hasStart();
+ /**
+ * <pre>
+ * Start time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval starts at minus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 start = 1;</code>
+ * @return The start.
+ */
+ long getStart();
+
+ /**
+ * <pre>
+ * End time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval ends at plus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 end = 2;</code>
+ * @return Whether the end field is set.
+ */
+ boolean hasEnd();
+ /**
+ * <pre>
+ * End time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval ends at plus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 end = 2;</code>
+ * @return The end.
+ */
+ long getEnd();
+ }
+ /**
+ * <pre>
+ * A time interval. The interval is considered active at time 't' if 't' is
+ * greater than or equal to the start time and less than the end time.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TimeRange}
+ */
+ public static final class TimeRange extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ TimeRange> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.TimeRange)
+ TimeRangeOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use TimeRange.newBuilder() to construct.
+ private TimeRange(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.TimeRange, ?> builder) {
+ super(builder);
+ }
+ private TimeRange() {
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new TimeRange();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private TimeRange(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 8: {
+ bitField0_ |= 0x00000001;
+ start_ = input.readUInt64();
+ break;
+ }
+ case 16: {
+ bitField0_ |= 0x00000002;
+ end_ = input.readUInt64();
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TimeRange_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TimeRange_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TimeRange.class, com.google.transit.realtime.GtfsRealtime.TimeRange.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int START_FIELD_NUMBER = 1;
+ private long start_;
+ /**
+ * <pre>
+ * Start time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval starts at minus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 start = 1;</code>
+ * @return Whether the start field is set.
+ */
+ @java.lang.Override
+ public boolean hasStart() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Start time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval starts at minus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 start = 1;</code>
+ * @return The start.
+ */
+ @java.lang.Override
+ public long getStart() {
+ return start_;
+ }
+
+ public static final int END_FIELD_NUMBER = 2;
+ private long end_;
+ /**
+ * <pre>
+ * End time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval ends at plus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 end = 2;</code>
+ * @return Whether the end field is set.
+ */
+ @java.lang.Override
+ public boolean hasEnd() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * End time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval ends at plus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 end = 2;</code>
+ * @return The end.
+ */
+ @java.lang.Override
+ public long getEnd() {
+ return end_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.TimeRange>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ output.writeUInt64(1, start_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ output.writeUInt64(2, end_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(1, start_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(2, end_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.TimeRange)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.TimeRange other = (com.google.transit.realtime.GtfsRealtime.TimeRange) obj;
+
+ if (hasStart() != other.hasStart()) return false;
+ if (hasStart()) {
+ if (getStart()
+ != other.getStart()) return false;
+ }
+ if (hasEnd() != other.hasEnd()) return false;
+ if (hasEnd()) {
+ if (getEnd()
+ != other.getEnd()) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasStart()) {
+ hash = (37 * hash) + START_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getStart());
+ }
+ if (hasEnd()) {
+ hash = (37 * hash) + END_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getEnd());
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.TimeRange prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * A time interval. The interval is considered active at time 't' if 't' is
+ * greater than or equal to the start time and less than the end time.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TimeRange}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.TimeRange, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.TimeRange)
+ com.google.transit.realtime.GtfsRealtime.TimeRangeOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TimeRange_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TimeRange_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TimeRange.class, com.google.transit.realtime.GtfsRealtime.TimeRange.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.TimeRange.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ start_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ end_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TimeRange_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TimeRange getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.TimeRange.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TimeRange build() {
+ com.google.transit.realtime.GtfsRealtime.TimeRange result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TimeRange buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.TimeRange result = new com.google.transit.realtime.GtfsRealtime.TimeRange(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ result.start_ = start_;
+ to_bitField0_ |= 0x00000001;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ result.end_ = end_;
+ to_bitField0_ |= 0x00000002;
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TimeRange, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TimeRange, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TimeRange, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TimeRange, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.TimeRange) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.TimeRange)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TimeRange other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.TimeRange.getDefaultInstance()) return this;
+ if (other.hasStart()) {
+ setStart(other.getStart());
+ }
+ if (other.hasEnd()) {
+ setEnd(other.getEnd());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.TimeRange parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.TimeRange) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private long start_ ;
+ /**
+ * <pre>
+ * Start time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval starts at minus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 start = 1;</code>
+ * @return Whether the start field is set.
+ */
+ @java.lang.Override
+ public boolean hasStart() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Start time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval starts at minus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 start = 1;</code>
+ * @return The start.
+ */
+ @java.lang.Override
+ public long getStart() {
+ return start_;
+ }
+ /**
+ * <pre>
+ * Start time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval starts at minus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 start = 1;</code>
+ * @param value The start to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStart(long value) {
+ bitField0_ |= 0x00000001;
+ start_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Start time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval starts at minus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 start = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearStart() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ start_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private long end_ ;
+ /**
+ * <pre>
+ * End time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval ends at plus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 end = 2;</code>
+ * @return Whether the end field is set.
+ */
+ @java.lang.Override
+ public boolean hasEnd() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * End time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval ends at plus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 end = 2;</code>
+ * @return The end.
+ */
+ @java.lang.Override
+ public long getEnd() {
+ return end_;
+ }
+ /**
+ * <pre>
+ * End time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval ends at plus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 end = 2;</code>
+ * @param value The end to set.
+ * @return This builder for chaining.
+ */
+ public Builder setEnd(long value) {
+ bitField0_ |= 0x00000002;
+ end_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * End time, in POSIX time (i.e., number of seconds since January 1st 1970
+ * 00:00:00 UTC).
+ * If missing, the interval ends at plus infinity.
+ * </pre>
+ *
+ * <code>optional uint64 end = 2;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearEnd() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ end_ = 0L;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.TimeRange)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.TimeRange)
+ private static final com.google.transit.realtime.GtfsRealtime.TimeRange DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.TimeRange();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TimeRange getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<TimeRange>
+ PARSER = new com.google.protobuf.AbstractParser<TimeRange>() {
+ @java.lang.Override
+ public TimeRange parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new TimeRange(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<TimeRange> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<TimeRange> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TimeRange getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PositionOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.Position)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<Position> {
+
+ /**
+ * <pre>
+ * Degrees North, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float latitude = 1;</code>
+ * @return Whether the latitude field is set.
+ */
+ boolean hasLatitude();
+ /**
+ * <pre>
+ * Degrees North, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float latitude = 1;</code>
+ * @return The latitude.
+ */
+ float getLatitude();
+
+ /**
+ * <pre>
+ * Degrees East, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float longitude = 2;</code>
+ * @return Whether the longitude field is set.
+ */
+ boolean hasLongitude();
+ /**
+ * <pre>
+ * Degrees East, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float longitude = 2;</code>
+ * @return The longitude.
+ */
+ float getLongitude();
+
+ /**
+ * <pre>
+ * Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East.
+ * This can be the compass bearing, or the direction towards the next stop
+ * or intermediate location.
+ * This should not be direction deduced from the sequence of previous
+ * positions, which can be computed from previous data.
+ * </pre>
+ *
+ * <code>optional float bearing = 3;</code>
+ * @return Whether the bearing field is set.
+ */
+ boolean hasBearing();
+ /**
+ * <pre>
+ * Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East.
+ * This can be the compass bearing, or the direction towards the next stop
+ * or intermediate location.
+ * This should not be direction deduced from the sequence of previous
+ * positions, which can be computed from previous data.
+ * </pre>
+ *
+ * <code>optional float bearing = 3;</code>
+ * @return The bearing.
+ */
+ float getBearing();
+
+ /**
+ * <pre>
+ * Odometer value, in meters.
+ * </pre>
+ *
+ * <code>optional double odometer = 4;</code>
+ * @return Whether the odometer field is set.
+ */
+ boolean hasOdometer();
+ /**
+ * <pre>
+ * Odometer value, in meters.
+ * </pre>
+ *
+ * <code>optional double odometer = 4;</code>
+ * @return The odometer.
+ */
+ double getOdometer();
+
+ /**
+ * <pre>
+ * Momentary speed measured by the vehicle, in meters per second.
+ * </pre>
+ *
+ * <code>optional float speed = 5;</code>
+ * @return Whether the speed field is set.
+ */
+ boolean hasSpeed();
+ /**
+ * <pre>
+ * Momentary speed measured by the vehicle, in meters per second.
+ * </pre>
+ *
+ * <code>optional float speed = 5;</code>
+ * @return The speed.
+ */
+ float getSpeed();
+ }
+ /**
+ * <pre>
+ * A position.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.Position}
+ */
+ public static final class Position extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ Position> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.Position)
+ PositionOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Position.newBuilder() to construct.
+ private Position(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.Position, ?> builder) {
+ super(builder);
+ }
+ private Position() {
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new Position();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Position(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 13: {
+ bitField0_ |= 0x00000001;
+ latitude_ = input.readFloat();
+ break;
+ }
+ case 21: {
+ bitField0_ |= 0x00000002;
+ longitude_ = input.readFloat();
+ break;
+ }
+ case 29: {
+ bitField0_ |= 0x00000004;
+ bearing_ = input.readFloat();
+ break;
+ }
+ case 33: {
+ bitField0_ |= 0x00000008;
+ odometer_ = input.readDouble();
+ break;
+ }
+ case 45: {
+ bitField0_ |= 0x00000010;
+ speed_ = input.readFloat();
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Position_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Position_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.Position.class, com.google.transit.realtime.GtfsRealtime.Position.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int LATITUDE_FIELD_NUMBER = 1;
+ private float latitude_;
+ /**
+ * <pre>
+ * Degrees North, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float latitude = 1;</code>
+ * @return Whether the latitude field is set.
+ */
+ @java.lang.Override
+ public boolean hasLatitude() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Degrees North, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float latitude = 1;</code>
+ * @return The latitude.
+ */
+ @java.lang.Override
+ public float getLatitude() {
+ return latitude_;
+ }
+
+ public static final int LONGITUDE_FIELD_NUMBER = 2;
+ private float longitude_;
+ /**
+ * <pre>
+ * Degrees East, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float longitude = 2;</code>
+ * @return Whether the longitude field is set.
+ */
+ @java.lang.Override
+ public boolean hasLongitude() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Degrees East, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float longitude = 2;</code>
+ * @return The longitude.
+ */
+ @java.lang.Override
+ public float getLongitude() {
+ return longitude_;
+ }
+
+ public static final int BEARING_FIELD_NUMBER = 3;
+ private float bearing_;
+ /**
+ * <pre>
+ * Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East.
+ * This can be the compass bearing, or the direction towards the next stop
+ * or intermediate location.
+ * This should not be direction deduced from the sequence of previous
+ * positions, which can be computed from previous data.
+ * </pre>
+ *
+ * <code>optional float bearing = 3;</code>
+ * @return Whether the bearing field is set.
+ */
+ @java.lang.Override
+ public boolean hasBearing() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East.
+ * This can be the compass bearing, or the direction towards the next stop
+ * or intermediate location.
+ * This should not be direction deduced from the sequence of previous
+ * positions, which can be computed from previous data.
+ * </pre>
+ *
+ * <code>optional float bearing = 3;</code>
+ * @return The bearing.
+ */
+ @java.lang.Override
+ public float getBearing() {
+ return bearing_;
+ }
+
+ public static final int ODOMETER_FIELD_NUMBER = 4;
+ private double odometer_;
+ /**
+ * <pre>
+ * Odometer value, in meters.
+ * </pre>
+ *
+ * <code>optional double odometer = 4;</code>
+ * @return Whether the odometer field is set.
+ */
+ @java.lang.Override
+ public boolean hasOdometer() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <pre>
+ * Odometer value, in meters.
+ * </pre>
+ *
+ * <code>optional double odometer = 4;</code>
+ * @return The odometer.
+ */
+ @java.lang.Override
+ public double getOdometer() {
+ return odometer_;
+ }
+
+ public static final int SPEED_FIELD_NUMBER = 5;
+ private float speed_;
+ /**
+ * <pre>
+ * Momentary speed measured by the vehicle, in meters per second.
+ * </pre>
+ *
+ * <code>optional float speed = 5;</code>
+ * @return Whether the speed field is set.
+ */
+ @java.lang.Override
+ public boolean hasSpeed() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <pre>
+ * Momentary speed measured by the vehicle, in meters per second.
+ * </pre>
+ *
+ * <code>optional float speed = 5;</code>
+ * @return The speed.
+ */
+ @java.lang.Override
+ public float getSpeed() {
+ return speed_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasLatitude()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasLongitude()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.Position>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ output.writeFloat(1, latitude_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ output.writeFloat(2, longitude_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeFloat(3, bearing_);
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ output.writeDouble(4, odometer_);
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ output.writeFloat(5, speed_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeFloatSize(1, latitude_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeFloatSize(2, longitude_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeFloatSize(3, bearing_);
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeDoubleSize(4, odometer_);
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeFloatSize(5, speed_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.Position)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.Position other = (com.google.transit.realtime.GtfsRealtime.Position) obj;
+
+ if (hasLatitude() != other.hasLatitude()) return false;
+ if (hasLatitude()) {
+ if (java.lang.Float.floatToIntBits(getLatitude())
+ != java.lang.Float.floatToIntBits(
+ other.getLatitude())) return false;
+ }
+ if (hasLongitude() != other.hasLongitude()) return false;
+ if (hasLongitude()) {
+ if (java.lang.Float.floatToIntBits(getLongitude())
+ != java.lang.Float.floatToIntBits(
+ other.getLongitude())) return false;
+ }
+ if (hasBearing() != other.hasBearing()) return false;
+ if (hasBearing()) {
+ if (java.lang.Float.floatToIntBits(getBearing())
+ != java.lang.Float.floatToIntBits(
+ other.getBearing())) return false;
+ }
+ if (hasOdometer() != other.hasOdometer()) return false;
+ if (hasOdometer()) {
+ if (java.lang.Double.doubleToLongBits(getOdometer())
+ != java.lang.Double.doubleToLongBits(
+ other.getOdometer())) return false;
+ }
+ if (hasSpeed() != other.hasSpeed()) return false;
+ if (hasSpeed()) {
+ if (java.lang.Float.floatToIntBits(getSpeed())
+ != java.lang.Float.floatToIntBits(
+ other.getSpeed())) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasLatitude()) {
+ hash = (37 * hash) + LATITUDE_FIELD_NUMBER;
+ hash = (53 * hash) + java.lang.Float.floatToIntBits(
+ getLatitude());
+ }
+ if (hasLongitude()) {
+ hash = (37 * hash) + LONGITUDE_FIELD_NUMBER;
+ hash = (53 * hash) + java.lang.Float.floatToIntBits(
+ getLongitude());
+ }
+ if (hasBearing()) {
+ hash = (37 * hash) + BEARING_FIELD_NUMBER;
+ hash = (53 * hash) + java.lang.Float.floatToIntBits(
+ getBearing());
+ }
+ if (hasOdometer()) {
+ hash = (37 * hash) + ODOMETER_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ java.lang.Double.doubleToLongBits(getOdometer()));
+ }
+ if (hasSpeed()) {
+ hash = (37 * hash) + SPEED_FIELD_NUMBER;
+ hash = (53 * hash) + java.lang.Float.floatToIntBits(
+ getSpeed());
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.Position parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.Position prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * A position.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.Position}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.Position, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.Position)
+ com.google.transit.realtime.GtfsRealtime.PositionOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Position_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Position_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.Position.class, com.google.transit.realtime.GtfsRealtime.Position.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.Position.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ latitude_ = 0F;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ longitude_ = 0F;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ bearing_ = 0F;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ odometer_ = 0D;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ speed_ = 0F;
+ bitField0_ = (bitField0_ & ~0x00000010);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_Position_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Position getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.Position.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Position build() {
+ com.google.transit.realtime.GtfsRealtime.Position result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Position buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.Position result = new com.google.transit.realtime.GtfsRealtime.Position(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ result.latitude_ = latitude_;
+ to_bitField0_ |= 0x00000001;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ result.longitude_ = longitude_;
+ to_bitField0_ |= 0x00000002;
+ }
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.bearing_ = bearing_;
+ to_bitField0_ |= 0x00000004;
+ }
+ if (((from_bitField0_ & 0x00000008) != 0)) {
+ result.odometer_ = odometer_;
+ to_bitField0_ |= 0x00000008;
+ }
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ result.speed_ = speed_;
+ to_bitField0_ |= 0x00000010;
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.Position, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.Position, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.Position, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.Position, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.Position) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.Position)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.Position other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.Position.getDefaultInstance()) return this;
+ if (other.hasLatitude()) {
+ setLatitude(other.getLatitude());
+ }
+ if (other.hasLongitude()) {
+ setLongitude(other.getLongitude());
+ }
+ if (other.hasBearing()) {
+ setBearing(other.getBearing());
+ }
+ if (other.hasOdometer()) {
+ setOdometer(other.getOdometer());
+ }
+ if (other.hasSpeed()) {
+ setSpeed(other.getSpeed());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!hasLatitude()) {
+ return false;
+ }
+ if (!hasLongitude()) {
+ return false;
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.Position parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.Position) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private float latitude_ ;
+ /**
+ * <pre>
+ * Degrees North, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float latitude = 1;</code>
+ * @return Whether the latitude field is set.
+ */
+ @java.lang.Override
+ public boolean hasLatitude() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Degrees North, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float latitude = 1;</code>
+ * @return The latitude.
+ */
+ @java.lang.Override
+ public float getLatitude() {
+ return latitude_;
+ }
+ /**
+ * <pre>
+ * Degrees North, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float latitude = 1;</code>
+ * @param value The latitude to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLatitude(float value) {
+ bitField0_ |= 0x00000001;
+ latitude_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Degrees North, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float latitude = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearLatitude() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ latitude_ = 0F;
+ onChanged();
+ return this;
+ }
+
+ private float longitude_ ;
+ /**
+ * <pre>
+ * Degrees East, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float longitude = 2;</code>
+ * @return Whether the longitude field is set.
+ */
+ @java.lang.Override
+ public boolean hasLongitude() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * Degrees East, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float longitude = 2;</code>
+ * @return The longitude.
+ */
+ @java.lang.Override
+ public float getLongitude() {
+ return longitude_;
+ }
+ /**
+ * <pre>
+ * Degrees East, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float longitude = 2;</code>
+ * @param value The longitude to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLongitude(float value) {
+ bitField0_ |= 0x00000002;
+ longitude_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Degrees East, in the WGS-84 coordinate system.
+ * </pre>
+ *
+ * <code>required float longitude = 2;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearLongitude() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ longitude_ = 0F;
+ onChanged();
+ return this;
+ }
+
+ private float bearing_ ;
+ /**
+ * <pre>
+ * Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East.
+ * This can be the compass bearing, or the direction towards the next stop
+ * or intermediate location.
+ * This should not be direction deduced from the sequence of previous
+ * positions, which can be computed from previous data.
+ * </pre>
+ *
+ * <code>optional float bearing = 3;</code>
+ * @return Whether the bearing field is set.
+ */
+ @java.lang.Override
+ public boolean hasBearing() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East.
+ * This can be the compass bearing, or the direction towards the next stop
+ * or intermediate location.
+ * This should not be direction deduced from the sequence of previous
+ * positions, which can be computed from previous data.
+ * </pre>
+ *
+ * <code>optional float bearing = 3;</code>
+ * @return The bearing.
+ */
+ @java.lang.Override
+ public float getBearing() {
+ return bearing_;
+ }
+ /**
+ * <pre>
+ * Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East.
+ * This can be the compass bearing, or the direction towards the next stop
+ * or intermediate location.
+ * This should not be direction deduced from the sequence of previous
+ * positions, which can be computed from previous data.
+ * </pre>
+ *
+ * <code>optional float bearing = 3;</code>
+ * @param value The bearing to set.
+ * @return This builder for chaining.
+ */
+ public Builder setBearing(float value) {
+ bitField0_ |= 0x00000004;
+ bearing_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East.
+ * This can be the compass bearing, or the direction towards the next stop
+ * or intermediate location.
+ * This should not be direction deduced from the sequence of previous
+ * positions, which can be computed from previous data.
+ * </pre>
+ *
+ * <code>optional float bearing = 3;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearBearing() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ bearing_ = 0F;
+ onChanged();
+ return this;
+ }
+
+ private double odometer_ ;
+ /**
+ * <pre>
+ * Odometer value, in meters.
+ * </pre>
+ *
+ * <code>optional double odometer = 4;</code>
+ * @return Whether the odometer field is set.
+ */
+ @java.lang.Override
+ public boolean hasOdometer() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <pre>
+ * Odometer value, in meters.
+ * </pre>
+ *
+ * <code>optional double odometer = 4;</code>
+ * @return The odometer.
+ */
+ @java.lang.Override
+ public double getOdometer() {
+ return odometer_;
+ }
+ /**
+ * <pre>
+ * Odometer value, in meters.
+ * </pre>
+ *
+ * <code>optional double odometer = 4;</code>
+ * @param value The odometer to set.
+ * @return This builder for chaining.
+ */
+ public Builder setOdometer(double value) {
+ bitField0_ |= 0x00000008;
+ odometer_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Odometer value, in meters.
+ * </pre>
+ *
+ * <code>optional double odometer = 4;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearOdometer() {
+ bitField0_ = (bitField0_ & ~0x00000008);
+ odometer_ = 0D;
+ onChanged();
+ return this;
+ }
+
+ private float speed_ ;
+ /**
+ * <pre>
+ * Momentary speed measured by the vehicle, in meters per second.
+ * </pre>
+ *
+ * <code>optional float speed = 5;</code>
+ * @return Whether the speed field is set.
+ */
+ @java.lang.Override
+ public boolean hasSpeed() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <pre>
+ * Momentary speed measured by the vehicle, in meters per second.
+ * </pre>
+ *
+ * <code>optional float speed = 5;</code>
+ * @return The speed.
+ */
+ @java.lang.Override
+ public float getSpeed() {
+ return speed_;
+ }
+ /**
+ * <pre>
+ * Momentary speed measured by the vehicle, in meters per second.
+ * </pre>
+ *
+ * <code>optional float speed = 5;</code>
+ * @param value The speed to set.
+ * @return This builder for chaining.
+ */
+ public Builder setSpeed(float value) {
+ bitField0_ |= 0x00000010;
+ speed_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Momentary speed measured by the vehicle, in meters per second.
+ * </pre>
+ *
+ * <code>optional float speed = 5;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearSpeed() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ speed_ = 0F;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.Position)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.Position)
+ private static final com.google.transit.realtime.GtfsRealtime.Position DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.Position();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.Position getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<Position>
+ PARSER = new com.google.protobuf.AbstractParser<Position>() {
+ @java.lang.Override
+ public Position parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Position(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<Position> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Position> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.Position getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface TripDescriptorOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.TripDescriptor)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<TripDescriptor> {
+
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return Whether the tripId field is set.
+ */
+ boolean hasTripId();
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return The tripId.
+ */
+ java.lang.String getTripId();
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return The bytes for tripId.
+ */
+ com.google.protobuf.ByteString
+ getTripIdBytes();
+
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return Whether the routeId field is set.
+ */
+ boolean hasRouteId();
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return The routeId.
+ */
+ java.lang.String getRouteId();
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return The bytes for routeId.
+ */
+ com.google.protobuf.ByteString
+ getRouteIdBytes();
+
+ /**
+ * <pre>
+ * The direction_id from the GTFS feed trips.txt file, indicating the
+ * direction of travel for trips this selector refers to. This field is
+ * still experimental, and subject to change. It may be formally adopted in
+ * the future.
+ * </pre>
+ *
+ * <code>optional uint32 direction_id = 6;</code>
+ * @return Whether the directionId field is set.
+ */
+ boolean hasDirectionId();
+ /**
+ * <pre>
+ * The direction_id from the GTFS feed trips.txt file, indicating the
+ * direction of travel for trips this selector refers to. This field is
+ * still experimental, and subject to change. It may be formally adopted in
+ * the future.
+ * </pre>
+ *
+ * <code>optional uint32 direction_id = 6;</code>
+ * @return The directionId.
+ */
+ int getDirectionId();
+
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return Whether the startTime field is set.
+ */
+ boolean hasStartTime();
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return The startTime.
+ */
+ java.lang.String getStartTime();
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return The bytes for startTime.
+ */
+ com.google.protobuf.ByteString
+ getStartTimeBytes();
+
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return Whether the startDate field is set.
+ */
+ boolean hasStartDate();
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return The startDate.
+ */
+ java.lang.String getStartDate();
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return The bytes for startDate.
+ */
+ com.google.protobuf.ByteString
+ getStartDateBytes();
+
+ /**
+ * <code>optional .transit_realtime.TripDescriptor.ScheduleRelationship schedule_relationship = 4;</code>
+ * @return Whether the scheduleRelationship field is set.
+ */
+ boolean hasScheduleRelationship();
+ /**
+ * <code>optional .transit_realtime.TripDescriptor.ScheduleRelationship schedule_relationship = 4;</code>
+ * @return The scheduleRelationship.
+ */
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship getScheduleRelationship();
+ }
+ /**
+ * <pre>
+ * A descriptor that identifies an instance of a GTFS trip, or all instances of
+ * a trip along a route.
+ * - To specify a single trip instance, the trip_id (and if necessary,
+ * start_time) is set. If route_id is also set, then it should be same as one
+ * that the given trip corresponds to.
+ * - To specify all the trips along a given route, only the route_id should be
+ * set. Note that if the trip_id is not known, then stop sequence ids in
+ * TripUpdate are not sufficient, and stop_ids must be provided as well. In
+ * addition, absolute arrival/departure times must be provided.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TripDescriptor}
+ */
+ public static final class TripDescriptor extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ TripDescriptor> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.TripDescriptor)
+ TripDescriptorOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use TripDescriptor.newBuilder() to construct.
+ private TripDescriptor(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.TripDescriptor, ?> builder) {
+ super(builder);
+ }
+ private TripDescriptor() {
+ tripId_ = "";
+ routeId_ = "";
+ startTime_ = "";
+ startDate_ = "";
+ scheduleRelationship_ = 0;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new TripDescriptor();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private TripDescriptor(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000001;
+ tripId_ = bs;
+ break;
+ }
+ case 18: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000008;
+ startTime_ = bs;
+ break;
+ }
+ case 26: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000010;
+ startDate_ = bs;
+ break;
+ }
+ case 32: {
+ int rawValue = input.readEnum();
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship value = com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(4, rawValue);
+ } else {
+ bitField0_ |= 0x00000020;
+ scheduleRelationship_ = rawValue;
+ }
+ break;
+ }
+ case 42: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000002;
+ routeId_ = bs;
+ break;
+ }
+ case 48: {
+ bitField0_ |= 0x00000004;
+ directionId_ = input.readUInt32();
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripDescriptor_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripDescriptor_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.class, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder.class);
+ }
+
+ /**
+ * <pre>
+ * The relation between this trip and the static schedule. If a trip is done
+ * in accordance with temporary schedule, not reflected in GTFS, then it
+ * shouldn't be marked as SCHEDULED, but likely as ADDED.
+ * </pre>
+ *
+ * Protobuf enum {@code transit_realtime.TripDescriptor.ScheduleRelationship}
+ */
+ public enum ScheduleRelationship
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <pre>
+ * Trip that is running in accordance with its GTFS schedule, or is close
+ * enough to the scheduled trip to be associated with it.
+ * </pre>
+ *
+ * <code>SCHEDULED = 0;</code>
+ */
+ SCHEDULED(0),
+ /**
+ * <pre>
+ * An extra trip that was added in addition to a running schedule, for
+ * example, to replace a broken vehicle or to respond to sudden passenger
+ * load.
+ * </pre>
+ *
+ * <code>ADDED = 1;</code>
+ */
+ ADDED(1),
+ /**
+ * <pre>
+ * A trip that is running with no schedule associated to it, for example, if
+ * there is no schedule at all.
+ * </pre>
+ *
+ * <code>UNSCHEDULED = 2;</code>
+ */
+ UNSCHEDULED(2),
+ /**
+ * <pre>
+ * A trip that existed in the schedule but was removed.
+ * </pre>
+ *
+ * <code>CANCELED = 3;</code>
+ */
+ CANCELED(3),
+ ;
+
+ /**
+ * <pre>
+ * Trip that is running in accordance with its GTFS schedule, or is close
+ * enough to the scheduled trip to be associated with it.
+ * </pre>
+ *
+ * <code>SCHEDULED = 0;</code>
+ */
+ public static final int SCHEDULED_VALUE = 0;
+ /**
+ * <pre>
+ * An extra trip that was added in addition to a running schedule, for
+ * example, to replace a broken vehicle or to respond to sudden passenger
+ * load.
+ * </pre>
+ *
+ * <code>ADDED = 1;</code>
+ */
+ public static final int ADDED_VALUE = 1;
+ /**
+ * <pre>
+ * A trip that is running with no schedule associated to it, for example, if
+ * there is no schedule at all.
+ * </pre>
+ *
+ * <code>UNSCHEDULED = 2;</code>
+ */
+ public static final int UNSCHEDULED_VALUE = 2;
+ /**
+ * <pre>
+ * A trip that existed in the schedule but was removed.
+ * </pre>
+ *
+ * <code>CANCELED = 3;</code>
+ */
+ public static final int CANCELED_VALUE = 3;
+
+
+ public final int getNumber() {
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static ScheduleRelationship valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static ScheduleRelationship forNumber(int value) {
+ switch (value) {
+ case 0: return SCHEDULED;
+ case 1: return ADDED;
+ case 2: return UNSCHEDULED;
+ case 3: return CANCELED;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<ScheduleRelationship>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ ScheduleRelationship> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<ScheduleRelationship>() {
+ public ScheduleRelationship findValueByNumber(int number) {
+ return ScheduleRelationship.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final ScheduleRelationship[] VALUES = values();
+
+ public static ScheduleRelationship valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private ScheduleRelationship(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:transit_realtime.TripDescriptor.ScheduleRelationship)
+ }
+
+ private int bitField0_;
+ public static final int TRIP_ID_FIELD_NUMBER = 1;
+ private volatile java.lang.Object tripId_;
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return Whether the tripId field is set.
+ */
+ @java.lang.Override
+ public boolean hasTripId() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return The tripId.
+ */
+ @java.lang.Override
+ public java.lang.String getTripId() {
+ java.lang.Object ref = tripId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ tripId_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return The bytes for tripId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getTripIdBytes() {
+ java.lang.Object ref = tripId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ tripId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int ROUTE_ID_FIELD_NUMBER = 5;
+ private volatile java.lang.Object routeId_;
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return Whether the routeId field is set.
+ */
+ @java.lang.Override
+ public boolean hasRouteId() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return The routeId.
+ */
+ @java.lang.Override
+ public java.lang.String getRouteId() {
+ java.lang.Object ref = routeId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ routeId_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return The bytes for routeId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getRouteIdBytes() {
+ java.lang.Object ref = routeId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ routeId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int DIRECTION_ID_FIELD_NUMBER = 6;
+ private int directionId_;
+ /**
+ * <pre>
+ * The direction_id from the GTFS feed trips.txt file, indicating the
+ * direction of travel for trips this selector refers to. This field is
+ * still experimental, and subject to change. It may be formally adopted in
+ * the future.
+ * </pre>
+ *
+ * <code>optional uint32 direction_id = 6;</code>
+ * @return Whether the directionId field is set.
+ */
+ @java.lang.Override
+ public boolean hasDirectionId() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * The direction_id from the GTFS feed trips.txt file, indicating the
+ * direction of travel for trips this selector refers to. This field is
+ * still experimental, and subject to change. It may be formally adopted in
+ * the future.
+ * </pre>
+ *
+ * <code>optional uint32 direction_id = 6;</code>
+ * @return The directionId.
+ */
+ @java.lang.Override
+ public int getDirectionId() {
+ return directionId_;
+ }
+
+ public static final int START_TIME_FIELD_NUMBER = 2;
+ private volatile java.lang.Object startTime_;
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return Whether the startTime field is set.
+ */
+ @java.lang.Override
+ public boolean hasStartTime() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return The startTime.
+ */
+ @java.lang.Override
+ public java.lang.String getStartTime() {
+ java.lang.Object ref = startTime_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ startTime_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return The bytes for startTime.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getStartTimeBytes() {
+ java.lang.Object ref = startTime_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ startTime_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int START_DATE_FIELD_NUMBER = 3;
+ private volatile java.lang.Object startDate_;
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return Whether the startDate field is set.
+ */
+ @java.lang.Override
+ public boolean hasStartDate() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return The startDate.
+ */
+ @java.lang.Override
+ public java.lang.String getStartDate() {
+ java.lang.Object ref = startDate_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ startDate_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return The bytes for startDate.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getStartDateBytes() {
+ java.lang.Object ref = startDate_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ startDate_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int SCHEDULE_RELATIONSHIP_FIELD_NUMBER = 4;
+ private int scheduleRelationship_;
+ /**
+ * <code>optional .transit_realtime.TripDescriptor.ScheduleRelationship schedule_relationship = 4;</code>
+ * @return Whether the scheduleRelationship field is set.
+ */
+ @java.lang.Override public boolean hasScheduleRelationship() {
+ return ((bitField0_ & 0x00000020) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor.ScheduleRelationship schedule_relationship = 4;</code>
+ * @return The scheduleRelationship.
+ */
+ @java.lang.Override public com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship getScheduleRelationship() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship result = com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship.valueOf(scheduleRelationship_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship.SCHEDULED : result;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.TripDescriptor>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tripId_);
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, startTime_);
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 3, startDate_);
+ }
+ if (((bitField0_ & 0x00000020) != 0)) {
+ output.writeEnum(4, scheduleRelationship_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 5, routeId_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeUInt32(6, directionId_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tripId_);
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, startTime_);
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, startDate_);
+ }
+ if (((bitField0_ & 0x00000020) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(4, scheduleRelationship_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, routeId_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(6, directionId_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.TripDescriptor)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor other = (com.google.transit.realtime.GtfsRealtime.TripDescriptor) obj;
+
+ if (hasTripId() != other.hasTripId()) return false;
+ if (hasTripId()) {
+ if (!getTripId()
+ .equals(other.getTripId())) return false;
+ }
+ if (hasRouteId() != other.hasRouteId()) return false;
+ if (hasRouteId()) {
+ if (!getRouteId()
+ .equals(other.getRouteId())) return false;
+ }
+ if (hasDirectionId() != other.hasDirectionId()) return false;
+ if (hasDirectionId()) {
+ if (getDirectionId()
+ != other.getDirectionId()) return false;
+ }
+ if (hasStartTime() != other.hasStartTime()) return false;
+ if (hasStartTime()) {
+ if (!getStartTime()
+ .equals(other.getStartTime())) return false;
+ }
+ if (hasStartDate() != other.hasStartDate()) return false;
+ if (hasStartDate()) {
+ if (!getStartDate()
+ .equals(other.getStartDate())) return false;
+ }
+ if (hasScheduleRelationship() != other.hasScheduleRelationship()) return false;
+ if (hasScheduleRelationship()) {
+ if (scheduleRelationship_ != other.scheduleRelationship_) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasTripId()) {
+ hash = (37 * hash) + TRIP_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getTripId().hashCode();
+ }
+ if (hasRouteId()) {
+ hash = (37 * hash) + ROUTE_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getRouteId().hashCode();
+ }
+ if (hasDirectionId()) {
+ hash = (37 * hash) + DIRECTION_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getDirectionId();
+ }
+ if (hasStartTime()) {
+ hash = (37 * hash) + START_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getStartTime().hashCode();
+ }
+ if (hasStartDate()) {
+ hash = (37 * hash) + START_DATE_FIELD_NUMBER;
+ hash = (53 * hash) + getStartDate().hashCode();
+ }
+ if (hasScheduleRelationship()) {
+ hash = (37 * hash) + SCHEDULE_RELATIONSHIP_FIELD_NUMBER;
+ hash = (53 * hash) + scheduleRelationship_;
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.TripDescriptor prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * A descriptor that identifies an instance of a GTFS trip, or all instances of
+ * a trip along a route.
+ * - To specify a single trip instance, the trip_id (and if necessary,
+ * start_time) is set. If route_id is also set, then it should be same as one
+ * that the given trip corresponds to.
+ * - To specify all the trips along a given route, only the route_id should be
+ * set. Note that if the trip_id is not known, then stop sequence ids in
+ * TripUpdate are not sufficient, and stop_ids must be provided as well. In
+ * addition, absolute arrival/departure times must be provided.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TripDescriptor}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.TripDescriptor)
+ com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripDescriptor_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripDescriptor_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.class, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.TripDescriptor.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ tripId_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ routeId_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ directionId_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ startTime_ = "";
+ bitField0_ = (bitField0_ & ~0x00000008);
+ startDate_ = "";
+ bitField0_ = (bitField0_ & ~0x00000010);
+ scheduleRelationship_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000020);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TripDescriptor_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor build() {
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor result = new com.google.transit.realtime.GtfsRealtime.TripDescriptor(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.tripId_ = tripId_;
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.routeId_ = routeId_;
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.directionId_ = directionId_;
+ to_bitField0_ |= 0x00000004;
+ }
+ if (((from_bitField0_ & 0x00000008) != 0)) {
+ to_bitField0_ |= 0x00000008;
+ }
+ result.startTime_ = startTime_;
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ result.startDate_ = startDate_;
+ if (((from_bitField0_ & 0x00000020) != 0)) {
+ to_bitField0_ |= 0x00000020;
+ }
+ result.scheduleRelationship_ = scheduleRelationship_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.TripDescriptor) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.TripDescriptor)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TripDescriptor other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance()) return this;
+ if (other.hasTripId()) {
+ bitField0_ |= 0x00000001;
+ tripId_ = other.tripId_;
+ onChanged();
+ }
+ if (other.hasRouteId()) {
+ bitField0_ |= 0x00000002;
+ routeId_ = other.routeId_;
+ onChanged();
+ }
+ if (other.hasDirectionId()) {
+ setDirectionId(other.getDirectionId());
+ }
+ if (other.hasStartTime()) {
+ bitField0_ |= 0x00000008;
+ startTime_ = other.startTime_;
+ onChanged();
+ }
+ if (other.hasStartDate()) {
+ bitField0_ |= 0x00000010;
+ startDate_ = other.startDate_;
+ onChanged();
+ }
+ if (other.hasScheduleRelationship()) {
+ setScheduleRelationship(other.getScheduleRelationship());
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.TripDescriptor) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private java.lang.Object tripId_ = "";
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return Whether the tripId field is set.
+ */
+ public boolean hasTripId() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return The tripId.
+ */
+ public java.lang.String getTripId() {
+ java.lang.Object ref = tripId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ tripId_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return The bytes for tripId.
+ */
+ public com.google.protobuf.ByteString
+ getTripIdBytes() {
+ java.lang.Object ref = tripId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ tripId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @param value The tripId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTripId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ tripId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearTripId() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ tripId_ = getDefaultInstance().getTripId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The trip_id from the GTFS feed that this selector refers to.
+ * For non frequency-based trips, this field is enough to uniquely identify
+ * the trip. For frequency-based trip, start_time and start_date might also be
+ * necessary.
+ * </pre>
+ *
+ * <code>optional string trip_id = 1;</code>
+ * @param value The bytes for tripId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTripIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ tripId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object routeId_ = "";
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return Whether the routeId field is set.
+ */
+ public boolean hasRouteId() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return The routeId.
+ */
+ public java.lang.String getRouteId() {
+ java.lang.Object ref = routeId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ routeId_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return The bytes for routeId.
+ */
+ public com.google.protobuf.ByteString
+ getRouteIdBytes() {
+ java.lang.Object ref = routeId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ routeId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @param value The routeId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRouteId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ routeId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearRouteId() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ routeId_ = getDefaultInstance().getRouteId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The route_id from the GTFS that this selector refers to.
+ * </pre>
+ *
+ * <code>optional string route_id = 5;</code>
+ * @param value The bytes for routeId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRouteIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ routeId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private int directionId_ ;
+ /**
+ * <pre>
+ * The direction_id from the GTFS feed trips.txt file, indicating the
+ * direction of travel for trips this selector refers to. This field is
+ * still experimental, and subject to change. It may be formally adopted in
+ * the future.
+ * </pre>
+ *
+ * <code>optional uint32 direction_id = 6;</code>
+ * @return Whether the directionId field is set.
+ */
+ @java.lang.Override
+ public boolean hasDirectionId() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * The direction_id from the GTFS feed trips.txt file, indicating the
+ * direction of travel for trips this selector refers to. This field is
+ * still experimental, and subject to change. It may be formally adopted in
+ * the future.
+ * </pre>
+ *
+ * <code>optional uint32 direction_id = 6;</code>
+ * @return The directionId.
+ */
+ @java.lang.Override
+ public int getDirectionId() {
+ return directionId_;
+ }
+ /**
+ * <pre>
+ * The direction_id from the GTFS feed trips.txt file, indicating the
+ * direction of travel for trips this selector refers to. This field is
+ * still experimental, and subject to change. It may be formally adopted in
+ * the future.
+ * </pre>
+ *
+ * <code>optional uint32 direction_id = 6;</code>
+ * @param value The directionId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDirectionId(int value) {
+ bitField0_ |= 0x00000004;
+ directionId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The direction_id from the GTFS feed trips.txt file, indicating the
+ * direction of travel for trips this selector refers to. This field is
+ * still experimental, and subject to change. It may be formally adopted in
+ * the future.
+ * </pre>
+ *
+ * <code>optional uint32 direction_id = 6;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearDirectionId() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ directionId_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object startTime_ = "";
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return Whether the startTime field is set.
+ */
+ public boolean hasStartTime() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return The startTime.
+ */
+ public java.lang.String getStartTime() {
+ java.lang.Object ref = startTime_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ startTime_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return The bytes for startTime.
+ */
+ public com.google.protobuf.ByteString
+ getStartTimeBytes() {
+ java.lang.Object ref = startTime_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ startTime_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @param value The startTime to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStartTime(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000008;
+ startTime_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearStartTime() {
+ bitField0_ = (bitField0_ & ~0x00000008);
+ startTime_ = getDefaultInstance().getStartTime();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The initially scheduled start time of this trip instance.
+ * When the trip_id corresponds to a non-frequency-based trip, this field
+ * should either be omitted or be equal to the value in the GTFS feed. When
+ * the trip_id corresponds to a frequency-based trip, the start_time must be
+ * specified for trip updates and vehicle positions. If the trip corresponds
+ * to exact_times=1 GTFS record, then start_time must be some multiple
+ * (including zero) of headway_secs later than frequencies.txt start_time for
+ * the corresponding time period. If the trip corresponds to exact_times=0,
+ * then its start_time may be arbitrary, and is initially expected to be the
+ * first departure of the trip. Once established, the start_time of this
+ * frequency-based trip should be considered immutable, even if the first
+ * departure time changes -- that time change may instead be reflected in a
+ * StopTimeUpdate.
+ * Format and semantics of the field is same as that of
+ * GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+ * </pre>
+ *
+ * <code>optional string start_time = 2;</code>
+ * @param value The bytes for startTime to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStartTimeBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000008;
+ startTime_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object startDate_ = "";
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return Whether the startDate field is set.
+ */
+ public boolean hasStartDate() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return The startDate.
+ */
+ public java.lang.String getStartDate() {
+ java.lang.Object ref = startDate_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ startDate_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return The bytes for startDate.
+ */
+ public com.google.protobuf.ByteString
+ getStartDateBytes() {
+ java.lang.Object ref = startDate_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ startDate_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @param value The startDate to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStartDate(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000010;
+ startDate_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearStartDate() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ startDate_ = getDefaultInstance().getStartDate();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The scheduled start date of this trip instance.
+ * Must be provided to disambiguate trips that are so late as to collide with
+ * a scheduled trip on a next day. For example, for a train that departs 8:00
+ * and 20:00 every day, and is 12 hours late, there would be two distinct
+ * trips on the same time.
+ * This field can be provided but is not mandatory for schedules in which such
+ * collisions are impossible - for example, a service running on hourly
+ * schedule where a vehicle that is one hour late is not considered to be
+ * related to schedule anymore.
+ * In YYYYMMDD format.
+ * </pre>
+ *
+ * <code>optional string start_date = 3;</code>
+ * @param value The bytes for startDate to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStartDateBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000010;
+ startDate_ = value;
+ onChanged();
+ return this;
+ }
+
+ private int scheduleRelationship_ = 0;
+ /**
+ * <code>optional .transit_realtime.TripDescriptor.ScheduleRelationship schedule_relationship = 4;</code>
+ * @return Whether the scheduleRelationship field is set.
+ */
+ @java.lang.Override public boolean hasScheduleRelationship() {
+ return ((bitField0_ & 0x00000020) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor.ScheduleRelationship schedule_relationship = 4;</code>
+ * @return The scheduleRelationship.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship getScheduleRelationship() {
+ @SuppressWarnings("deprecation")
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship result = com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship.valueOf(scheduleRelationship_);
+ return result == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship.SCHEDULED : result;
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor.ScheduleRelationship schedule_relationship = 4;</code>
+ * @param value The scheduleRelationship to set.
+ * @return This builder for chaining.
+ */
+ public Builder setScheduleRelationship(com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000020;
+ scheduleRelationship_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor.ScheduleRelationship schedule_relationship = 4;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearScheduleRelationship() {
+ bitField0_ = (bitField0_ & ~0x00000020);
+ scheduleRelationship_ = 0;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.TripDescriptor)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.TripDescriptor)
+ private static final com.google.transit.realtime.GtfsRealtime.TripDescriptor DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.TripDescriptor();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TripDescriptor getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<TripDescriptor>
+ PARSER = new com.google.protobuf.AbstractParser<TripDescriptor>() {
+ @java.lang.Override
+ public TripDescriptor parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new TripDescriptor(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<TripDescriptor> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<TripDescriptor> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface VehicleDescriptorOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.VehicleDescriptor)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<VehicleDescriptor> {
+
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return Whether the id field is set.
+ */
+ boolean hasId();
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return The id.
+ */
+ java.lang.String getId();
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return The bytes for id.
+ */
+ com.google.protobuf.ByteString
+ getIdBytes();
+
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return Whether the label field is set.
+ */
+ boolean hasLabel();
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return The label.
+ */
+ java.lang.String getLabel();
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return The bytes for label.
+ */
+ com.google.protobuf.ByteString
+ getLabelBytes();
+
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return Whether the licensePlate field is set.
+ */
+ boolean hasLicensePlate();
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return The licensePlate.
+ */
+ java.lang.String getLicensePlate();
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return The bytes for licensePlate.
+ */
+ com.google.protobuf.ByteString
+ getLicensePlateBytes();
+ }
+ /**
+ * <pre>
+ * Identification information for the vehicle performing the trip.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.VehicleDescriptor}
+ */
+ public static final class VehicleDescriptor extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ VehicleDescriptor> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.VehicleDescriptor)
+ VehicleDescriptorOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use VehicleDescriptor.newBuilder() to construct.
+ private VehicleDescriptor(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, ?> builder) {
+ super(builder);
+ }
+ private VehicleDescriptor() {
+ id_ = "";
+ label_ = "";
+ licensePlate_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new VehicleDescriptor();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private VehicleDescriptor(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000001;
+ id_ = bs;
+ break;
+ }
+ case 18: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000002;
+ label_ = bs;
+ break;
+ }
+ case 26: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000004;
+ licensePlate_ = bs;
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehicleDescriptor_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehicleDescriptor_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.class, com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int ID_FIELD_NUMBER = 1;
+ private volatile java.lang.Object id_;
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return Whether the id field is set.
+ */
+ @java.lang.Override
+ public boolean hasId() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return The id.
+ */
+ @java.lang.Override
+ public java.lang.String getId() {
+ java.lang.Object ref = id_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ id_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return The bytes for id.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getIdBytes() {
+ java.lang.Object ref = id_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ id_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int LABEL_FIELD_NUMBER = 2;
+ private volatile java.lang.Object label_;
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return Whether the label field is set.
+ */
+ @java.lang.Override
+ public boolean hasLabel() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return The label.
+ */
+ @java.lang.Override
+ public java.lang.String getLabel() {
+ java.lang.Object ref = label_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ label_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return The bytes for label.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getLabelBytes() {
+ java.lang.Object ref = label_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ label_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int LICENSE_PLATE_FIELD_NUMBER = 3;
+ private volatile java.lang.Object licensePlate_;
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return Whether the licensePlate field is set.
+ */
+ @java.lang.Override
+ public boolean hasLicensePlate() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return The licensePlate.
+ */
+ @java.lang.Override
+ public java.lang.String getLicensePlate() {
+ java.lang.Object ref = licensePlate_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ licensePlate_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return The bytes for licensePlate.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getLicensePlateBytes() {
+ java.lang.Object ref = licensePlate_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ licensePlate_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.VehicleDescriptor>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, label_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 3, licensePlate_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, label_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, licensePlate_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.VehicleDescriptor)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor other = (com.google.transit.realtime.GtfsRealtime.VehicleDescriptor) obj;
+
+ if (hasId() != other.hasId()) return false;
+ if (hasId()) {
+ if (!getId()
+ .equals(other.getId())) return false;
+ }
+ if (hasLabel() != other.hasLabel()) return false;
+ if (hasLabel()) {
+ if (!getLabel()
+ .equals(other.getLabel())) return false;
+ }
+ if (hasLicensePlate() != other.hasLicensePlate()) return false;
+ if (hasLicensePlate()) {
+ if (!getLicensePlate()
+ .equals(other.getLicensePlate())) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasId()) {
+ hash = (37 * hash) + ID_FIELD_NUMBER;
+ hash = (53 * hash) + getId().hashCode();
+ }
+ if (hasLabel()) {
+ hash = (37 * hash) + LABEL_FIELD_NUMBER;
+ hash = (53 * hash) + getLabel().hashCode();
+ }
+ if (hasLicensePlate()) {
+ hash = (37 * hash) + LICENSE_PLATE_FIELD_NUMBER;
+ hash = (53 * hash) + getLicensePlate().hashCode();
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * Identification information for the vehicle performing the trip.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.VehicleDescriptor}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.VehicleDescriptor)
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptorOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehicleDescriptor_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehicleDescriptor_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.class, com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ id_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ label_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ licensePlate_ = "";
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_VehicleDescriptor_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor build() {
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor result = new com.google.transit.realtime.GtfsRealtime.VehicleDescriptor(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.id_ = id_;
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.label_ = label_;
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ result.licensePlate_ = licensePlate_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.VehicleDescriptor) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.VehicleDescriptor)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance()) return this;
+ if (other.hasId()) {
+ bitField0_ |= 0x00000001;
+ id_ = other.id_;
+ onChanged();
+ }
+ if (other.hasLabel()) {
+ bitField0_ |= 0x00000002;
+ label_ = other.label_;
+ onChanged();
+ }
+ if (other.hasLicensePlate()) {
+ bitField0_ |= 0x00000004;
+ licensePlate_ = other.licensePlate_;
+ onChanged();
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.VehicleDescriptor parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.VehicleDescriptor) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private java.lang.Object id_ = "";
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return Whether the id field is set.
+ */
+ public boolean hasId() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return The id.
+ */
+ public java.lang.String getId() {
+ java.lang.Object ref = id_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ id_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return The bytes for id.
+ */
+ public com.google.protobuf.ByteString
+ getIdBytes() {
+ java.lang.Object ref = id_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ id_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @param value The id to set.
+ * @return This builder for chaining.
+ */
+ public Builder setId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ id_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearId() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ id_ = getDefaultInstance().getId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * Internal system identification of the vehicle. Should be unique per
+ * vehicle, and can be used for tracking the vehicle as it proceeds through
+ * the system.
+ * </pre>
+ *
+ * <code>optional string id = 1;</code>
+ * @param value The bytes for id to set.
+ * @return This builder for chaining.
+ */
+ public Builder setIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ id_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object label_ = "";
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return Whether the label field is set.
+ */
+ public boolean hasLabel() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return The label.
+ */
+ public java.lang.String getLabel() {
+ java.lang.Object ref = label_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ label_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return The bytes for label.
+ */
+ public com.google.protobuf.ByteString
+ getLabelBytes() {
+ java.lang.Object ref = label_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ label_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @param value The label to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLabel(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ label_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearLabel() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ label_ = getDefaultInstance().getLabel();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * User visible label, i.e., something that must be shown to the passenger to
+ * help identify the correct vehicle.
+ * </pre>
+ *
+ * <code>optional string label = 2;</code>
+ * @param value The bytes for label to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLabelBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ label_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object licensePlate_ = "";
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return Whether the licensePlate field is set.
+ */
+ public boolean hasLicensePlate() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return The licensePlate.
+ */
+ public java.lang.String getLicensePlate() {
+ java.lang.Object ref = licensePlate_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ licensePlate_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return The bytes for licensePlate.
+ */
+ public com.google.protobuf.ByteString
+ getLicensePlateBytes() {
+ java.lang.Object ref = licensePlate_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ licensePlate_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @param value The licensePlate to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLicensePlate(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ licensePlate_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearLicensePlate() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ licensePlate_ = getDefaultInstance().getLicensePlate();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The license plate of the vehicle.
+ * </pre>
+ *
+ * <code>optional string license_plate = 3;</code>
+ * @param value The bytes for licensePlate to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLicensePlateBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ licensePlate_ = value;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.VehicleDescriptor)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.VehicleDescriptor)
+ private static final com.google.transit.realtime.GtfsRealtime.VehicleDescriptor DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.VehicleDescriptor();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.VehicleDescriptor getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<VehicleDescriptor>
+ PARSER = new com.google.protobuf.AbstractParser<VehicleDescriptor>() {
+ @java.lang.Override
+ public VehicleDescriptor parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new VehicleDescriptor(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<VehicleDescriptor> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<VehicleDescriptor> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.VehicleDescriptor getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface EntitySelectorOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.EntitySelector)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<EntitySelector> {
+
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return Whether the agencyId field is set.
+ */
+ boolean hasAgencyId();
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return The agencyId.
+ */
+ java.lang.String getAgencyId();
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return The bytes for agencyId.
+ */
+ com.google.protobuf.ByteString
+ getAgencyIdBytes();
+
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return Whether the routeId field is set.
+ */
+ boolean hasRouteId();
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return The routeId.
+ */
+ java.lang.String getRouteId();
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return The bytes for routeId.
+ */
+ com.google.protobuf.ByteString
+ getRouteIdBytes();
+
+ /**
+ * <pre>
+ * corresponds to route_type in GTFS.
+ * </pre>
+ *
+ * <code>optional int32 route_type = 3;</code>
+ * @return Whether the routeType field is set.
+ */
+ boolean hasRouteType();
+ /**
+ * <pre>
+ * corresponds to route_type in GTFS.
+ * </pre>
+ *
+ * <code>optional int32 route_type = 3;</code>
+ * @return The routeType.
+ */
+ int getRouteType();
+
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ * @return Whether the trip field is set.
+ */
+ boolean hasTrip();
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ * @return The trip.
+ */
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor getTrip();
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder getTripOrBuilder();
+
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return Whether the stopId field is set.
+ */
+ boolean hasStopId();
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return The stopId.
+ */
+ java.lang.String getStopId();
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return The bytes for stopId.
+ */
+ com.google.protobuf.ByteString
+ getStopIdBytes();
+ }
+ /**
+ * <pre>
+ * A selector for an entity in a GTFS feed.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.EntitySelector}
+ */
+ public static final class EntitySelector extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ EntitySelector> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.EntitySelector)
+ EntitySelectorOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use EntitySelector.newBuilder() to construct.
+ private EntitySelector(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.EntitySelector, ?> builder) {
+ super(builder);
+ }
+ private EntitySelector() {
+ agencyId_ = "";
+ routeId_ = "";
+ stopId_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new EntitySelector();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private EntitySelector(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000001;
+ agencyId_ = bs;
+ break;
+ }
+ case 18: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000002;
+ routeId_ = bs;
+ break;
+ }
+ case 24: {
+ bitField0_ |= 0x00000004;
+ routeType_ = input.readInt32();
+ break;
+ }
+ case 34: {
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) != 0)) {
+ subBuilder = trip_.toBuilder();
+ }
+ trip_ = input.readMessage(com.google.transit.realtime.GtfsRealtime.TripDescriptor.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(trip_);
+ trip_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 42: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000010;
+ stopId_ = bs;
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_EntitySelector_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_EntitySelector_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.EntitySelector.class, com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int AGENCY_ID_FIELD_NUMBER = 1;
+ private volatile java.lang.Object agencyId_;
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return Whether the agencyId field is set.
+ */
+ @java.lang.Override
+ public boolean hasAgencyId() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return The agencyId.
+ */
+ @java.lang.Override
+ public java.lang.String getAgencyId() {
+ java.lang.Object ref = agencyId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ agencyId_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return The bytes for agencyId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getAgencyIdBytes() {
+ java.lang.Object ref = agencyId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ agencyId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int ROUTE_ID_FIELD_NUMBER = 2;
+ private volatile java.lang.Object routeId_;
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return Whether the routeId field is set.
+ */
+ @java.lang.Override
+ public boolean hasRouteId() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return The routeId.
+ */
+ @java.lang.Override
+ public java.lang.String getRouteId() {
+ java.lang.Object ref = routeId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ routeId_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return The bytes for routeId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getRouteIdBytes() {
+ java.lang.Object ref = routeId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ routeId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int ROUTE_TYPE_FIELD_NUMBER = 3;
+ private int routeType_;
+ /**
+ * <pre>
+ * corresponds to route_type in GTFS.
+ * </pre>
+ *
+ * <code>optional int32 route_type = 3;</code>
+ * @return Whether the routeType field is set.
+ */
+ @java.lang.Override
+ public boolean hasRouteType() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * corresponds to route_type in GTFS.
+ * </pre>
+ *
+ * <code>optional int32 route_type = 3;</code>
+ * @return The routeType.
+ */
+ @java.lang.Override
+ public int getRouteType() {
+ return routeType_;
+ }
+
+ public static final int TRIP_FIELD_NUMBER = 4;
+ private com.google.transit.realtime.GtfsRealtime.TripDescriptor trip_;
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ * @return Whether the trip field is set.
+ */
+ @java.lang.Override
+ public boolean hasTrip() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ * @return The trip.
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor getTrip() {
+ return trip_ == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder getTripOrBuilder() {
+ return trip_ == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ }
+
+ public static final int STOP_ID_FIELD_NUMBER = 5;
+ private volatile java.lang.Object stopId_;
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return Whether the stopId field is set.
+ */
+ @java.lang.Override
+ public boolean hasStopId() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return The stopId.
+ */
+ @java.lang.Override
+ public java.lang.String getStopId() {
+ java.lang.Object ref = stopId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ stopId_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return The bytes for stopId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getStopIdBytes() {
+ java.lang.Object ref = stopId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ stopId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (hasTrip()) {
+ if (!getTrip().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.EntitySelector>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, agencyId_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, routeId_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeInt32(3, routeType_);
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ output.writeMessage(4, getTrip());
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 5, stopId_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, agencyId_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, routeId_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(3, routeType_);
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, getTrip());
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, stopId_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.EntitySelector)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.EntitySelector other = (com.google.transit.realtime.GtfsRealtime.EntitySelector) obj;
+
+ if (hasAgencyId() != other.hasAgencyId()) return false;
+ if (hasAgencyId()) {
+ if (!getAgencyId()
+ .equals(other.getAgencyId())) return false;
+ }
+ if (hasRouteId() != other.hasRouteId()) return false;
+ if (hasRouteId()) {
+ if (!getRouteId()
+ .equals(other.getRouteId())) return false;
+ }
+ if (hasRouteType() != other.hasRouteType()) return false;
+ if (hasRouteType()) {
+ if (getRouteType()
+ != other.getRouteType()) return false;
+ }
+ if (hasTrip() != other.hasTrip()) return false;
+ if (hasTrip()) {
+ if (!getTrip()
+ .equals(other.getTrip())) return false;
+ }
+ if (hasStopId() != other.hasStopId()) return false;
+ if (hasStopId()) {
+ if (!getStopId()
+ .equals(other.getStopId())) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasAgencyId()) {
+ hash = (37 * hash) + AGENCY_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getAgencyId().hashCode();
+ }
+ if (hasRouteId()) {
+ hash = (37 * hash) + ROUTE_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getRouteId().hashCode();
+ }
+ if (hasRouteType()) {
+ hash = (37 * hash) + ROUTE_TYPE_FIELD_NUMBER;
+ hash = (53 * hash) + getRouteType();
+ }
+ if (hasTrip()) {
+ hash = (37 * hash) + TRIP_FIELD_NUMBER;
+ hash = (53 * hash) + getTrip().hashCode();
+ }
+ if (hasStopId()) {
+ hash = (37 * hash) + STOP_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getStopId().hashCode();
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.EntitySelector prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * A selector for an entity in a GTFS feed.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.EntitySelector}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.EntitySelector, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.EntitySelector)
+ com.google.transit.realtime.GtfsRealtime.EntitySelectorOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_EntitySelector_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_EntitySelector_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.EntitySelector.class, com.google.transit.realtime.GtfsRealtime.EntitySelector.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.EntitySelector.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ getTripFieldBuilder();
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ agencyId_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ routeId_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ routeType_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ if (tripBuilder_ == null) {
+ trip_ = null;
+ } else {
+ tripBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ stopId_ = "";
+ bitField0_ = (bitField0_ & ~0x00000010);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_EntitySelector_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.EntitySelector getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.EntitySelector.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.EntitySelector build() {
+ com.google.transit.realtime.GtfsRealtime.EntitySelector result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.EntitySelector buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.EntitySelector result = new com.google.transit.realtime.GtfsRealtime.EntitySelector(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.agencyId_ = agencyId_;
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.routeId_ = routeId_;
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.routeType_ = routeType_;
+ to_bitField0_ |= 0x00000004;
+ }
+ if (((from_bitField0_ & 0x00000008) != 0)) {
+ if (tripBuilder_ == null) {
+ result.trip_ = trip_;
+ } else {
+ result.trip_ = tripBuilder_.build();
+ }
+ to_bitField0_ |= 0x00000008;
+ }
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ result.stopId_ = stopId_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.EntitySelector, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.EntitySelector, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.EntitySelector, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.EntitySelector, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.EntitySelector) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.EntitySelector)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.EntitySelector other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.EntitySelector.getDefaultInstance()) return this;
+ if (other.hasAgencyId()) {
+ bitField0_ |= 0x00000001;
+ agencyId_ = other.agencyId_;
+ onChanged();
+ }
+ if (other.hasRouteId()) {
+ bitField0_ |= 0x00000002;
+ routeId_ = other.routeId_;
+ onChanged();
+ }
+ if (other.hasRouteType()) {
+ setRouteType(other.getRouteType());
+ }
+ if (other.hasTrip()) {
+ mergeTrip(other.getTrip());
+ }
+ if (other.hasStopId()) {
+ bitField0_ |= 0x00000010;
+ stopId_ = other.stopId_;
+ onChanged();
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (hasTrip()) {
+ if (!getTrip().isInitialized()) {
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.EntitySelector parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.EntitySelector) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private java.lang.Object agencyId_ = "";
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return Whether the agencyId field is set.
+ */
+ public boolean hasAgencyId() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return The agencyId.
+ */
+ public java.lang.String getAgencyId() {
+ java.lang.Object ref = agencyId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ agencyId_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return The bytes for agencyId.
+ */
+ public com.google.protobuf.ByteString
+ getAgencyIdBytes() {
+ java.lang.Object ref = agencyId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ agencyId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @param value The agencyId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setAgencyId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ agencyId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearAgencyId() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ agencyId_ = getDefaultInstance().getAgencyId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * The values of the fields should correspond to the appropriate fields in the
+ * GTFS feed.
+ * At least one specifier must be given. If several are given, then the
+ * matching has to apply to all the given specifiers.
+ * </pre>
+ *
+ * <code>optional string agency_id = 1;</code>
+ * @param value The bytes for agencyId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setAgencyIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ agencyId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object routeId_ = "";
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return Whether the routeId field is set.
+ */
+ public boolean hasRouteId() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return The routeId.
+ */
+ public java.lang.String getRouteId() {
+ java.lang.Object ref = routeId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ routeId_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return The bytes for routeId.
+ */
+ public com.google.protobuf.ByteString
+ getRouteIdBytes() {
+ java.lang.Object ref = routeId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ routeId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @param value The routeId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRouteId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ routeId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearRouteId() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ routeId_ = getDefaultInstance().getRouteId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string route_id = 2;</code>
+ * @param value The bytes for routeId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRouteIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ routeId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private int routeType_ ;
+ /**
+ * <pre>
+ * corresponds to route_type in GTFS.
+ * </pre>
+ *
+ * <code>optional int32 route_type = 3;</code>
+ * @return Whether the routeType field is set.
+ */
+ @java.lang.Override
+ public boolean hasRouteType() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ * <pre>
+ * corresponds to route_type in GTFS.
+ * </pre>
+ *
+ * <code>optional int32 route_type = 3;</code>
+ * @return The routeType.
+ */
+ @java.lang.Override
+ public int getRouteType() {
+ return routeType_;
+ }
+ /**
+ * <pre>
+ * corresponds to route_type in GTFS.
+ * </pre>
+ *
+ * <code>optional int32 route_type = 3;</code>
+ * @param value The routeType to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRouteType(int value) {
+ bitField0_ |= 0x00000004;
+ routeType_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * corresponds to route_type in GTFS.
+ * </pre>
+ *
+ * <code>optional int32 route_type = 3;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearRouteType() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ routeType_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.transit.realtime.GtfsRealtime.TripDescriptor trip_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder> tripBuilder_;
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ * @return Whether the trip field is set.
+ */
+ public boolean hasTrip() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ * @return The trip.
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor getTrip() {
+ if (tripBuilder_ == null) {
+ return trip_ == null ? com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ } else {
+ return tripBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ */
+ public Builder setTrip(com.google.transit.realtime.GtfsRealtime.TripDescriptor value) {
+ if (tripBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ trip_ = value;
+ onChanged();
+ } else {
+ tripBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ */
+ public Builder setTrip(
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder builderForValue) {
+ if (tripBuilder_ == null) {
+ trip_ = builderForValue.build();
+ onChanged();
+ } else {
+ tripBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ */
+ public Builder mergeTrip(com.google.transit.realtime.GtfsRealtime.TripDescriptor value) {
+ if (tripBuilder_ == null) {
+ if (((bitField0_ & 0x00000008) != 0) &&
+ trip_ != null &&
+ trip_ != com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance()) {
+ trip_ =
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.newBuilder(trip_).mergeFrom(value).buildPartial();
+ } else {
+ trip_ = value;
+ }
+ onChanged();
+ } else {
+ tripBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ */
+ public Builder clearTrip() {
+ if (tripBuilder_ == null) {
+ trip_ = null;
+ onChanged();
+ } else {
+ tripBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ return this;
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder getTripBuilder() {
+ bitField0_ |= 0x00000008;
+ onChanged();
+ return getTripFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder getTripOrBuilder() {
+ if (tripBuilder_ != null) {
+ return tripBuilder_.getMessageOrBuilder();
+ } else {
+ return trip_ == null ?
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor.getDefaultInstance() : trip_;
+ }
+ }
+ /**
+ * <code>optional .transit_realtime.TripDescriptor trip = 4;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder>
+ getTripFieldBuilder() {
+ if (tripBuilder_ == null) {
+ tripBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TripDescriptor, com.google.transit.realtime.GtfsRealtime.TripDescriptor.Builder, com.google.transit.realtime.GtfsRealtime.TripDescriptorOrBuilder>(
+ getTrip(),
+ getParentForChildren(),
+ isClean());
+ trip_ = null;
+ }
+ return tripBuilder_;
+ }
+
+ private java.lang.Object stopId_ = "";
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return Whether the stopId field is set.
+ */
+ public boolean hasStopId() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return The stopId.
+ */
+ public java.lang.String getStopId() {
+ java.lang.Object ref = stopId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ stopId_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return The bytes for stopId.
+ */
+ public com.google.protobuf.ByteString
+ getStopIdBytes() {
+ java.lang.Object ref = stopId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ stopId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @param value The stopId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStopId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000010;
+ stopId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearStopId() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ stopId_ = getDefaultInstance().getStopId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string stop_id = 5;</code>
+ * @param value The bytes for stopId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStopIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000010;
+ stopId_ = value;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.EntitySelector)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.EntitySelector)
+ private static final com.google.transit.realtime.GtfsRealtime.EntitySelector DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.EntitySelector();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.EntitySelector getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<EntitySelector>
+ PARSER = new com.google.protobuf.AbstractParser<EntitySelector>() {
+ @java.lang.Override
+ public EntitySelector parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new EntitySelector(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<EntitySelector> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<EntitySelector> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.EntitySelector getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface TranslatedStringOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.TranslatedString)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<TranslatedString> {
+
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ java.util.List<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation>
+ getTranslationList();
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation getTranslation(int index);
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ int getTranslationCount();
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ java.util.List<? extends com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder>
+ getTranslationOrBuilderList();
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder getTranslationOrBuilder(
+ int index);
+ }
+ /**
+ * <pre>
+ * An internationalized message containing per-language versions of a snippet of
+ * text or a URL.
+ * One of the strings from a message will be picked up. The resolution proceeds
+ * as follows:
+ * 1. If the UI language matches the language code of a translation,
+ * the first matching translation is picked.
+ * 2. If a default UI language (e.g., English) matches the language code of a
+ * translation, the first matching translation is picked.
+ * 3. If some translation has an unspecified language code, that translation is
+ * picked.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TranslatedString}
+ */
+ public static final class TranslatedString extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ TranslatedString> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.TranslatedString)
+ TranslatedStringOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use TranslatedString.newBuilder() to construct.
+ private TranslatedString(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.TranslatedString, ?> builder) {
+ super(builder);
+ }
+ private TranslatedString() {
+ translation_ = java.util.Collections.emptyList();
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new TranslatedString();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private TranslatedString(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ if (!((mutable_bitField0_ & 0x00000001) != 0)) {
+ translation_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ translation_.add(
+ input.readMessage(com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.PARSER, extensionRegistry));
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000001) != 0)) {
+ translation_ = java.util.Collections.unmodifiableList(translation_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.class, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder.class);
+ }
+
+ public interface TranslationOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:transit_realtime.TranslatedString.Translation)
+ com.google.protobuf.GeneratedMessageV3.
+ ExtendableMessageOrBuilder<Translation> {
+
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return Whether the text field is set.
+ */
+ boolean hasText();
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return The text.
+ */
+ java.lang.String getText();
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return The bytes for text.
+ */
+ com.google.protobuf.ByteString
+ getTextBytes();
+
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return Whether the language field is set.
+ */
+ boolean hasLanguage();
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return The language.
+ */
+ java.lang.String getLanguage();
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return The bytes for language.
+ */
+ com.google.protobuf.ByteString
+ getLanguageBytes();
+ }
+ /**
+ * Protobuf type {@code transit_realtime.TranslatedString.Translation}
+ */
+ public static final class Translation extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
+ Translation> implements
+ // @@protoc_insertion_point(message_implements:transit_realtime.TranslatedString.Translation)
+ TranslationOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Translation.newBuilder() to construct.
+ private Translation(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation, ?> builder) {
+ super(builder);
+ }
+ private Translation() {
+ text_ = "";
+ language_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new Translation();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Translation(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000001;
+ text_ = bs;
+ break;
+ }
+ case 18: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000002;
+ language_ = bs;
+ break;
+ }
+ default: {
+ if (!parseUnknownField(
+ input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_Translation_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_Translation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.class, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int TEXT_FIELD_NUMBER = 1;
+ private volatile java.lang.Object text_;
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return Whether the text field is set.
+ */
+ @java.lang.Override
+ public boolean hasText() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return The text.
+ */
+ @java.lang.Override
+ public java.lang.String getText() {
+ java.lang.Object ref = text_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ text_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return The bytes for text.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getTextBytes() {
+ java.lang.Object ref = text_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ text_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int LANGUAGE_FIELD_NUMBER = 2;
+ private volatile java.lang.Object language_;
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return Whether the language field is set.
+ */
+ @java.lang.Override
+ public boolean hasLanguage() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return The language.
+ */
+ @java.lang.Override
+ public java.lang.String getLanguage() {
+ java.lang.Object ref = language_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ language_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return The bytes for language.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getLanguageBytes() {
+ java.lang.Object ref = language_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ language_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasText()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ if (((bitField0_ & 0x00000001) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, language_);
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_);
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, language_);
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation other = (com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation) obj;
+
+ if (hasText() != other.hasText()) return false;
+ if (hasText()) {
+ if (!getText()
+ .equals(other.getText())) return false;
+ }
+ if (hasLanguage() != other.hasLanguage()) return false;
+ if (hasLanguage()) {
+ if (!getLanguage()
+ .equals(other.getLanguage())) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasText()) {
+ hash = (37 * hash) + TEXT_FIELD_NUMBER;
+ hash = (53 * hash) + getText().hashCode();
+ }
+ if (hasLanguage()) {
+ hash = (37 * hash) + LANGUAGE_FIELD_NUMBER;
+ hash = (53 * hash) + getLanguage().hashCode();
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code transit_realtime.TranslatedString.Translation}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.TranslatedString.Translation)
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_Translation_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_Translation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.class, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ text_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ language_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_Translation_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation build() {
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation result = new com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.text_ = text_;
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.language_ = language_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.getDefaultInstance()) return this;
+ if (other.hasText()) {
+ bitField0_ |= 0x00000001;
+ text_ = other.text_;
+ onChanged();
+ }
+ if (other.hasLanguage()) {
+ bitField0_ |= 0x00000002;
+ language_ = other.language_;
+ onChanged();
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ if (!hasText()) {
+ return false;
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private java.lang.Object text_ = "";
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return Whether the text field is set.
+ */
+ public boolean hasText() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return The text.
+ */
+ public java.lang.String getText() {
+ java.lang.Object ref = text_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ text_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return The bytes for text.
+ */
+ public com.google.protobuf.ByteString
+ getTextBytes() {
+ java.lang.Object ref = text_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ text_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @param value The text to set.
+ * @return This builder for chaining.
+ */
+ public Builder setText(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ text_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearText() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ text_ = getDefaultInstance().getText();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * A UTF-8 string containing the message.
+ * </pre>
+ *
+ * <code>required string text = 1;</code>
+ * @param value The bytes for text to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTextBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ text_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object language_ = "";
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return Whether the language field is set.
+ */
+ public boolean hasLanguage() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return The language.
+ */
+ public java.lang.String getLanguage() {
+ java.lang.Object ref = language_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ language_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return The bytes for language.
+ */
+ public com.google.protobuf.ByteString
+ getLanguageBytes() {
+ java.lang.Object ref = language_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ language_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @param value The language to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLanguage(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ language_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @return This builder for chaining.
+ */
+ public Builder clearLanguage() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ language_ = getDefaultInstance().getLanguage();
+ onChanged();
+ return this;
+ }
+ /**
+ * <pre>
+ * BCP-47 language code. Can be omitted if the language is unknown or if
+ * no i18n is done at all for the feed. At most one translation is
+ * allowed to have an unspecified language tag.
+ * </pre>
+ *
+ * <code>optional string language = 2;</code>
+ * @param value The bytes for language to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLanguageBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ language_ = value;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.TranslatedString.Translation)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.TranslatedString.Translation)
+ private static final com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<Translation>
+ PARSER = new com.google.protobuf.AbstractParser<Translation>() {
+ @java.lang.Override
+ public Translation parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Translation(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<Translation> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Translation> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public static final int TRANSLATION_FIELD_NUMBER = 1;
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation> translation_;
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ @java.lang.Override
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation> getTranslationList() {
+ return translation_;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ @java.lang.Override
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder>
+ getTranslationOrBuilderList() {
+ return translation_;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ @java.lang.Override
+ public int getTranslationCount() {
+ return translation_.size();
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation getTranslation(int index) {
+ return translation_.get(index);
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder getTranslationOrBuilder(
+ int index) {
+ return translation_.get(index);
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ for (int i = 0; i < getTranslationCount(); i++) {
+ if (!getTranslation(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ com.google.protobuf.GeneratedMessageV3
+ .ExtendableMessage<com.google.transit.realtime.GtfsRealtime.TranslatedString>.ExtensionWriter
+ extensionWriter = newExtensionWriter();
+ for (int i = 0; i < translation_.size(); i++) {
+ output.writeMessage(1, translation_.get(i));
+ }
+ extensionWriter.writeUntil(2000, output);
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < translation_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, translation_.get(i));
+ }
+ size += extensionsSerializedSize();
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.transit.realtime.GtfsRealtime.TranslatedString)) {
+ return super.equals(obj);
+ }
+ com.google.transit.realtime.GtfsRealtime.TranslatedString other = (com.google.transit.realtime.GtfsRealtime.TranslatedString) obj;
+
+ if (!getTranslationList()
+ .equals(other.getTranslationList())) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getExtensionFields().equals(other.getExtensionFields()))
+ return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (getTranslationCount() > 0) {
+ hash = (37 * hash) + TRANSLATION_FIELD_NUMBER;
+ hash = (53 * hash) + getTranslationList().hashCode();
+ }
+ hash = hashFields(hash, getExtensionFields());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.transit.realtime.GtfsRealtime.TranslatedString prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * <pre>
+ * An internationalized message containing per-language versions of a snippet of
+ * text or a URL.
+ * One of the strings from a message will be picked up. The resolution proceeds
+ * as follows:
+ * 1. If the UI language matches the language code of a translation,
+ * the first matching translation is picked.
+ * 2. If a default UI language (e.g., English) matches the language code of a
+ * translation, the first matching translation is picked.
+ * 3. If some translation has an unspecified language code, that translation is
+ * picked.
+ * </pre>
+ *
+ * Protobuf type {@code transit_realtime.TranslatedString}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, Builder> implements
+ // @@protoc_insertion_point(builder_implements:transit_realtime.TranslatedString)
+ com.google.transit.realtime.GtfsRealtime.TranslatedStringOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.class, com.google.transit.realtime.GtfsRealtime.TranslatedString.Builder.class);
+ }
+
+ // Construct using com.google.transit.realtime.GtfsRealtime.TranslatedString.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ getTranslationFieldBuilder();
+ }
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ if (translationBuilder_ == null) {
+ translation_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ translationBuilder_.clear();
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.google.transit.realtime.GtfsRealtime.internal_static_transit_realtime_TranslatedString_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString getDefaultInstanceForType() {
+ return com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString build() {
+ com.google.transit.realtime.GtfsRealtime.TranslatedString result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString buildPartial() {
+ com.google.transit.realtime.GtfsRealtime.TranslatedString result = new com.google.transit.realtime.GtfsRealtime.TranslatedString(this);
+ int from_bitField0_ = bitField0_;
+ if (translationBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) != 0)) {
+ translation_ = java.util.Collections.unmodifiableList(translation_);
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.translation_ = translation_;
+ } else {
+ result.translation_ = translationBuilder_.build();
+ }
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, Type> extension,
+ Type value) {
+ return super.setExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder setExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, java.util.List<Type>> extension,
+ int index, Type value) {
+ return super.setExtension(extension, index, value);
+ }
+ @java.lang.Override
+ public <Type> Builder addExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, java.util.List<Type>> extension,
+ Type value) {
+ return super.addExtension(extension, value);
+ }
+ @java.lang.Override
+ public <Type> Builder clearExtension(
+ com.google.protobuf.GeneratedMessage.GeneratedExtension<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString, ?> extension) {
+ return super.clearExtension(extension);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.transit.realtime.GtfsRealtime.TranslatedString) {
+ return mergeFrom((com.google.transit.realtime.GtfsRealtime.TranslatedString)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TranslatedString other) {
+ if (other == com.google.transit.realtime.GtfsRealtime.TranslatedString.getDefaultInstance()) return this;
+ if (translationBuilder_ == null) {
+ if (!other.translation_.isEmpty()) {
+ if (translation_.isEmpty()) {
+ translation_ = other.translation_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureTranslationIsMutable();
+ translation_.addAll(other.translation_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.translation_.isEmpty()) {
+ if (translationBuilder_.isEmpty()) {
+ translationBuilder_.dispose();
+ translationBuilder_ = null;
+ translation_ = other.translation_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ translationBuilder_ =
+ com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
+ getTranslationFieldBuilder() : null;
+ } else {
+ translationBuilder_.addAllMessages(other.translation_);
+ }
+ }
+ }
+ this.mergeExtensionFields(other);
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ for (int i = 0; i < getTranslationCount(); i++) {
+ if (!getTranslation(i).isInitialized()) {
+ return false;
+ }
+ }
+ if (!extensionsAreInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.google.transit.realtime.GtfsRealtime.TranslatedString parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.google.transit.realtime.GtfsRealtime.TranslatedString) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private java.util.List<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation> translation_ =
+ java.util.Collections.emptyList();
+ private void ensureTranslationIsMutable() {
+ if (!((bitField0_ & 0x00000001) != 0)) {
+ translation_ = new java.util.ArrayList<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation>(translation_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder> translationBuilder_;
+
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation> getTranslationList() {
+ if (translationBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(translation_);
+ } else {
+ return translationBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public int getTranslationCount() {
+ if (translationBuilder_ == null) {
+ return translation_.size();
+ } else {
+ return translationBuilder_.getCount();
+ }
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation getTranslation(int index) {
+ if (translationBuilder_ == null) {
+ return translation_.get(index);
+ } else {
+ return translationBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public Builder setTranslation(
+ int index, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation value) {
+ if (translationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureTranslationIsMutable();
+ translation_.set(index, value);
+ onChanged();
+ } else {
+ translationBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public Builder setTranslation(
+ int index, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder builderForValue) {
+ if (translationBuilder_ == null) {
+ ensureTranslationIsMutable();
+ translation_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ translationBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public Builder addTranslation(com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation value) {
+ if (translationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureTranslationIsMutable();
+ translation_.add(value);
+ onChanged();
+ } else {
+ translationBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public Builder addTranslation(
+ int index, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation value) {
+ if (translationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureTranslationIsMutable();
+ translation_.add(index, value);
+ onChanged();
+ } else {
+ translationBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public Builder addTranslation(
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder builderForValue) {
+ if (translationBuilder_ == null) {
+ ensureTranslationIsMutable();
+ translation_.add(builderForValue.build());
+ onChanged();
+ } else {
+ translationBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public Builder addTranslation(
+ int index, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder builderForValue) {
+ if (translationBuilder_ == null) {
+ ensureTranslationIsMutable();
+ translation_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ translationBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public Builder addAllTranslation(
+ java.lang.Iterable<? extends com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation> values) {
+ if (translationBuilder_ == null) {
+ ensureTranslationIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, translation_);
+ onChanged();
+ } else {
+ translationBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public Builder clearTranslation() {
+ if (translationBuilder_ == null) {
+ translation_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ translationBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public Builder removeTranslation(int index) {
+ if (translationBuilder_ == null) {
+ ensureTranslationIsMutable();
+ translation_.remove(index);
+ onChanged();
+ } else {
+ translationBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder getTranslationBuilder(
+ int index) {
+ return getTranslationFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder getTranslationOrBuilder(
+ int index) {
+ if (translationBuilder_ == null) {
+ return translation_.get(index); } else {
+ return translationBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public java.util.List<? extends com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder>
+ getTranslationOrBuilderList() {
+ if (translationBuilder_ != null) {
+ return translationBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(translation_);
+ }
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder addTranslationBuilder() {
+ return getTranslationFieldBuilder().addBuilder(
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder addTranslationBuilder(
+ int index) {
+ return getTranslationFieldBuilder().addBuilder(
+ index, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.getDefaultInstance());
+ }
+ /**
+ * <pre>
+ * At least one translation must be provided.
+ * </pre>
+ *
+ * <code>repeated .transit_realtime.TranslatedString.Translation translation = 1;</code>
+ */
+ public java.util.List<com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder>
+ getTranslationBuilderList() {
+ return getTranslationFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder>
+ getTranslationFieldBuilder() {
+ if (translationBuilder_ == null) {
+ translationBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+ com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation, com.google.transit.realtime.GtfsRealtime.TranslatedString.Translation.Builder, com.google.transit.realtime.GtfsRealtime.TranslatedString.TranslationOrBuilder>(
+ translation_,
+ ((bitField0_ & 0x00000001) != 0),
+ getParentForChildren(),
+ isClean());
+ translation_ = null;
+ }
+ return translationBuilder_;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:transit_realtime.TranslatedString)
+ }
+
+ // @@protoc_insertion_point(class_scope:transit_realtime.TranslatedString)
+ private static final com.google.transit.realtime.GtfsRealtime.TranslatedString DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.transit.realtime.GtfsRealtime.TranslatedString();
+ }
+
+ public static com.google.transit.realtime.GtfsRealtime.TranslatedString getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser<TranslatedString>
+ PARSER = new com.google.protobuf.AbstractParser<TranslatedString>() {
+ @java.lang.Override
+ public TranslatedString parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new TranslatedString(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser<TranslatedString> parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<TranslatedString> getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.transit.realtime.GtfsRealtime.TranslatedString getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_FeedMessage_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_FeedMessage_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_FeedHeader_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_FeedHeader_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_FeedEntity_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_FeedEntity_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_TripUpdate_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_TripUpdate_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_TripUpdate_StopTimeEvent_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_TripUpdate_StopTimeEvent_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_TripUpdate_StopTimeUpdate_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_TripUpdate_StopTimeUpdate_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_VehiclePosition_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_VehiclePosition_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_Alert_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_Alert_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_TimeRange_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_TimeRange_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_Position_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_Position_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_TripDescriptor_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_TripDescriptor_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_VehicleDescriptor_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_VehicleDescriptor_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_EntitySelector_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_EntitySelector_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_TranslatedString_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_TranslatedString_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_transit_realtime_TranslatedString_Translation_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_transit_realtime_TranslatedString_Translation_fieldAccessorTable;
+
+ public static com.google.protobuf.Descriptors.FileDescriptor
+ getDescriptor() {
+ return descriptor;
+ }
+ private static com.google.protobuf.Descriptors.FileDescriptor
+ descriptor;
+ static {
+ java.lang.String[] descriptorData = {
+ "\n\023gtfs-realtime.proto\022\020transit_realtime\"" +
+ "q\n\013FeedMessage\022,\n\006header\030\001 \002(\0132\034.transit" +
+ "_realtime.FeedHeader\022,\n\006entity\030\002 \003(\0132\034.t" +
+ "ransit_realtime.FeedEntity*\006\010\350\007\020\320\017\"\317\001\n\nF" +
+ "eedHeader\022\035\n\025gtfs_realtime_version\030\001 \002(\t" +
+ "\022Q\n\016incrementality\030\002 \001(\0162+.transit_realt" +
+ "ime.FeedHeader.Incrementality:\014FULL_DATA" +
+ "SET\022\021\n\ttimestamp\030\003 \001(\004\"4\n\016Incrementality" +
+ "\022\020\n\014FULL_DATASET\020\000\022\020\n\014DIFFERENTIAL\020\001*\006\010\350" +
+ "\007\020\320\017\"\312\001\n\nFeedEntity\022\n\n\002id\030\001 \002(\t\022\031\n\nis_de" +
+ "leted\030\002 \001(\010:\005false\0221\n\013trip_update\030\003 \001(\0132" +
+ "\034.transit_realtime.TripUpdate\0222\n\007vehicle" +
+ "\030\004 \001(\0132!.transit_realtime.VehiclePositio" +
+ "n\022&\n\005alert\030\005 \001(\0132\027.transit_realtime.Aler" +
+ "t*\006\010\350\007\020\320\017\"\232\005\n\nTripUpdate\022.\n\004trip\030\001 \002(\0132 " +
+ ".transit_realtime.TripDescriptor\0224\n\007vehi" +
+ "cle\030\003 \001(\0132#.transit_realtime.VehicleDesc" +
+ "riptor\022E\n\020stop_time_update\030\002 \003(\0132+.trans" +
+ "it_realtime.TripUpdate.StopTimeUpdate\022\021\n" +
+ "\ttimestamp\030\004 \001(\004\022\r\n\005delay\030\005 \001(\005\032I\n\rStopT" +
+ "imeEvent\022\r\n\005delay\030\001 \001(\005\022\014\n\004time\030\002 \001(\003\022\023\n" +
+ "\013uncertainty\030\003 \001(\005*\006\010\350\007\020\320\017\032\351\002\n\016StopTimeU" +
+ "pdate\022\025\n\rstop_sequence\030\001 \001(\r\022\017\n\007stop_id\030" +
+ "\004 \001(\t\022;\n\007arrival\030\002 \001(\0132*.transit_realtim" +
+ "e.TripUpdate.StopTimeEvent\022=\n\tdeparture\030" +
+ "\003 \001(\0132*.transit_realtime.TripUpdate.Stop" +
+ "TimeEvent\022j\n\025schedule_relationship\030\005 \001(\016" +
+ "2@.transit_realtime.TripUpdate.StopTimeU" +
+ "pdate.ScheduleRelationship:\tSCHEDULED\"?\n" +
+ "\024ScheduleRelationship\022\r\n\tSCHEDULED\020\000\022\013\n\007" +
+ "SKIPPED\020\001\022\013\n\007NO_DATA\020\002*\006\010\350\007\020\320\017*\006\010\350\007\020\320\017\"\340" +
+ "\006\n\017VehiclePosition\022.\n\004trip\030\001 \001(\0132 .trans" +
+ "it_realtime.TripDescriptor\0224\n\007vehicle\030\010 " +
+ "\001(\0132#.transit_realtime.VehicleDescriptor" +
+ "\022,\n\010position\030\002 \001(\0132\032.transit_realtime.Po" +
+ "sition\022\035\n\025current_stop_sequence\030\003 \001(\r\022\017\n" +
+ "\007stop_id\030\007 \001(\t\022Z\n\016current_status\030\004 \001(\01623" +
+ ".transit_realtime.VehiclePosition.Vehicl" +
+ "eStopStatus:\rIN_TRANSIT_TO\022\021\n\ttimestamp\030" +
+ "\005 \001(\004\022K\n\020congestion_level\030\006 \001(\01621.transi" +
+ "t_realtime.VehiclePosition.CongestionLev" +
+ "el\022K\n\020occupancy_status\030\t \001(\01621.transit_r" +
+ "ealtime.VehiclePosition.OccupancyStatus\"" +
+ "G\n\021VehicleStopStatus\022\017\n\013INCOMING_AT\020\000\022\016\n" +
+ "\nSTOPPED_AT\020\001\022\021\n\rIN_TRANSIT_TO\020\002\"}\n\017Cong" +
+ "estionLevel\022\034\n\030UNKNOWN_CONGESTION_LEVEL\020" +
+ "\000\022\024\n\020RUNNING_SMOOTHLY\020\001\022\017\n\013STOP_AND_GO\020\002" +
+ "\022\016\n\nCONGESTION\020\003\022\025\n\021SEVERE_CONGESTION\020\004\"" +
+ "\257\001\n\017OccupancyStatus\022\t\n\005EMPTY\020\000\022\030\n\024MANY_S" +
+ "EATS_AVAILABLE\020\001\022\027\n\023FEW_SEATS_AVAILABLE\020" +
+ "\002\022\026\n\022STANDING_ROOM_ONLY\020\003\022\036\n\032CRUSHED_STA" +
+ "NDING_ROOM_ONLY\020\004\022\010\n\004FULL\020\005\022\034\n\030NOT_ACCEP" +
+ "TING_PASSENGERS\020\006*\006\010\350\007\020\320\017\"\266\006\n\005Alert\0222\n\ra" +
+ "ctive_period\030\001 \003(\0132\033.transit_realtime.Ti" +
+ "meRange\0229\n\017informed_entity\030\005 \003(\0132 .trans" +
+ "it_realtime.EntitySelector\022;\n\005cause\030\006 \001(" +
+ "\0162\035.transit_realtime.Alert.Cause:\rUNKNOW" +
+ "N_CAUSE\022>\n\006effect\030\007 \001(\0162\036.transit_realti" +
+ "me.Alert.Effect:\016UNKNOWN_EFFECT\022/\n\003url\030\010" +
+ " \001(\0132\".transit_realtime.TranslatedString" +
+ "\0227\n\013header_text\030\n \001(\0132\".transit_realtime" +
+ ".TranslatedString\022<\n\020description_text\030\013 " +
+ "\001(\0132\".transit_realtime.TranslatedString\"" +
+ "\330\001\n\005Cause\022\021\n\rUNKNOWN_CAUSE\020\001\022\017\n\013OTHER_CA" +
+ "USE\020\002\022\025\n\021TECHNICAL_PROBLEM\020\003\022\n\n\006STRIKE\020\004" +
+ "\022\021\n\rDEMONSTRATION\020\005\022\014\n\010ACCIDENT\020\006\022\013\n\007HOL" +
+ "IDAY\020\007\022\013\n\007WEATHER\020\010\022\017\n\013MAINTENANCE\020\t\022\020\n\014" +
+ "CONSTRUCTION\020\n\022\023\n\017POLICE_ACTIVITY\020\013\022\025\n\021M" +
+ "EDICAL_EMERGENCY\020\014\"\265\001\n\006Effect\022\016\n\nNO_SERV" +
+ "ICE\020\001\022\023\n\017REDUCED_SERVICE\020\002\022\026\n\022SIGNIFICAN" +
+ "T_DELAYS\020\003\022\n\n\006DETOUR\020\004\022\026\n\022ADDITIONAL_SER" +
+ "VICE\020\005\022\024\n\020MODIFIED_SERVICE\020\006\022\020\n\014OTHER_EF" +
+ "FECT\020\007\022\022\n\016UNKNOWN_EFFECT\020\010\022\016\n\nSTOP_MOVED" +
+ "\020\t*\006\010\350\007\020\320\017\"/\n\tTimeRange\022\r\n\005start\030\001 \001(\004\022\013" +
+ "\n\003end\030\002 \001(\004*\006\010\350\007\020\320\017\"i\n\010Position\022\020\n\010latit" +
+ "ude\030\001 \002(\002\022\021\n\tlongitude\030\002 \002(\002\022\017\n\007bearing\030" +
+ "\003 \001(\002\022\020\n\010odometer\030\004 \001(\001\022\r\n\005speed\030\005 \001(\002*\006" +
+ "\010\350\007\020\320\017\"\240\002\n\016TripDescriptor\022\017\n\007trip_id\030\001 \001" +
+ "(\t\022\020\n\010route_id\030\005 \001(\t\022\024\n\014direction_id\030\006 \001" +
+ "(\r\022\022\n\nstart_time\030\002 \001(\t\022\022\n\nstart_date\030\003 \001" +
+ "(\t\022T\n\025schedule_relationship\030\004 \001(\01625.tran" +
+ "sit_realtime.TripDescriptor.ScheduleRela" +
+ "tionship\"O\n\024ScheduleRelationship\022\r\n\tSCHE" +
+ "DULED\020\000\022\t\n\005ADDED\020\001\022\017\n\013UNSCHEDULED\020\002\022\014\n\010C" +
+ "ANCELED\020\003*\006\010\350\007\020\320\017\"M\n\021VehicleDescriptor\022\n" +
+ "\n\002id\030\001 \001(\t\022\r\n\005label\030\002 \001(\t\022\025\n\rlicense_pla" +
+ "te\030\003 \001(\t*\006\010\350\007\020\320\017\"\222\001\n\016EntitySelector\022\021\n\ta" +
+ "gency_id\030\001 \001(\t\022\020\n\010route_id\030\002 \001(\t\022\022\n\nrout" +
+ "e_type\030\003 \001(\005\022.\n\004trip\030\004 \001(\0132 .transit_rea" +
+ "ltime.TripDescriptor\022\017\n\007stop_id\030\005 \001(\t*\006\010" +
+ "\350\007\020\320\017\"\226\001\n\020TranslatedString\022C\n\013translatio" +
+ "n\030\001 \003(\0132..transit_realtime.TranslatedStr" +
+ "ing.Translation\0325\n\013Translation\022\014\n\004text\030\001" +
+ " \002(\t\022\020\n\010language\030\002 \001(\t*\006\010\350\007\020\320\017*\006\010\350\007\020\320\017B\035" +
+ "\n\033com.google.transit.realtime"
+ };
+ descriptor = com.google.protobuf.Descriptors.FileDescriptor
+ .internalBuildGeneratedFileFrom(descriptorData,
+ new com.google.protobuf.Descriptors.FileDescriptor[] {
+ });
+ internal_static_transit_realtime_FeedMessage_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_transit_realtime_FeedMessage_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_FeedMessage_descriptor,
+ new java.lang.String[] { "Header", "Entity", });
+ internal_static_transit_realtime_FeedHeader_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_transit_realtime_FeedHeader_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_FeedHeader_descriptor,
+ new java.lang.String[] { "GtfsRealtimeVersion", "Incrementality", "Timestamp", });
+ internal_static_transit_realtime_FeedEntity_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_transit_realtime_FeedEntity_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_FeedEntity_descriptor,
+ new java.lang.String[] { "Id", "IsDeleted", "TripUpdate", "Vehicle", "Alert", });
+ internal_static_transit_realtime_TripUpdate_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_transit_realtime_TripUpdate_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_TripUpdate_descriptor,
+ new java.lang.String[] { "Trip", "Vehicle", "StopTimeUpdate", "Timestamp", "Delay", });
+ internal_static_transit_realtime_TripUpdate_StopTimeEvent_descriptor =
+ internal_static_transit_realtime_TripUpdate_descriptor.getNestedTypes().get(0);
+ internal_static_transit_realtime_TripUpdate_StopTimeEvent_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_TripUpdate_StopTimeEvent_descriptor,
+ new java.lang.String[] { "Delay", "Time", "Uncertainty", });
+ internal_static_transit_realtime_TripUpdate_StopTimeUpdate_descriptor =
+ internal_static_transit_realtime_TripUpdate_descriptor.getNestedTypes().get(1);
+ internal_static_transit_realtime_TripUpdate_StopTimeUpdate_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_TripUpdate_StopTimeUpdate_descriptor,
+ new java.lang.String[] { "StopSequence", "StopId", "Arrival", "Departure", "ScheduleRelationship", });
+ internal_static_transit_realtime_VehiclePosition_descriptor =
+ getDescriptor().getMessageTypes().get(4);
+ internal_static_transit_realtime_VehiclePosition_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_VehiclePosition_descriptor,
+ new java.lang.String[] { "Trip", "Vehicle", "Position", "CurrentStopSequence", "StopId", "CurrentStatus", "Timestamp", "CongestionLevel", "OccupancyStatus", });
+ internal_static_transit_realtime_Alert_descriptor =
+ getDescriptor().getMessageTypes().get(5);
+ internal_static_transit_realtime_Alert_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_Alert_descriptor,
+ new java.lang.String[] { "ActivePeriod", "InformedEntity", "Cause", "Effect", "Url", "HeaderText", "DescriptionText", });
+ internal_static_transit_realtime_TimeRange_descriptor =
+ getDescriptor().getMessageTypes().get(6);
+ internal_static_transit_realtime_TimeRange_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_TimeRange_descriptor,
+ new java.lang.String[] { "Start", "End", });
+ internal_static_transit_realtime_Position_descriptor =
+ getDescriptor().getMessageTypes().get(7);
+ internal_static_transit_realtime_Position_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_Position_descriptor,
+ new java.lang.String[] { "Latitude", "Longitude", "Bearing", "Odometer", "Speed", });
+ internal_static_transit_realtime_TripDescriptor_descriptor =
+ getDescriptor().getMessageTypes().get(8);
+ internal_static_transit_realtime_TripDescriptor_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_TripDescriptor_descriptor,
+ new java.lang.String[] { "TripId", "RouteId", "DirectionId", "StartTime", "StartDate", "ScheduleRelationship", });
+ internal_static_transit_realtime_VehicleDescriptor_descriptor =
+ getDescriptor().getMessageTypes().get(9);
+ internal_static_transit_realtime_VehicleDescriptor_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_VehicleDescriptor_descriptor,
+ new java.lang.String[] { "Id", "Label", "LicensePlate", });
+ internal_static_transit_realtime_EntitySelector_descriptor =
+ getDescriptor().getMessageTypes().get(10);
+ internal_static_transit_realtime_EntitySelector_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_EntitySelector_descriptor,
+ new java.lang.String[] { "AgencyId", "RouteId", "RouteType", "Trip", "StopId", });
+ internal_static_transit_realtime_TranslatedString_descriptor =
+ getDescriptor().getMessageTypes().get(11);
+ internal_static_transit_realtime_TranslatedString_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_TranslatedString_descriptor,
+ new java.lang.String[] { "Translation", });
+ internal_static_transit_realtime_TranslatedString_Translation_descriptor =
+ internal_static_transit_realtime_TranslatedString_descriptor.getNestedTypes().get(0);
+ internal_static_transit_realtime_TranslatedString_Translation_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_transit_realtime_TranslatedString_Translation_descriptor,
+ new java.lang.String[] { "Text", "Language", });
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
diff --git a/src/debug/AndroidManifest.xml b/src/debug/AndroidManifest.xml
--- a/src/debug/AndroidManifest.xml
+++ b/src/debug/AndroidManifest.xml
@@ -7,10 +7,17 @@
<application
tools:node="merge"
+ android:label="@string/app_name_debug"
+ tools:replace="android:label"
>
+ <activity
+ android:name=".ActivityMain"
+ android:label="@string/app_name_debug"
+ tools:replace="android:label"
+ />
<provider
- android:name=".middleware.AppDataProvider"
+ android:name=".data.AppDataProvider"
android:authorities="it.reyboz.bustorino.debug.provider"
android:enabled="true"
android:exported="false"
diff --git a/src/it/reyboz/bustorino/ActivityFavorites.java b/src/it/reyboz/bustorino/ActivityFavorites.java
--- a/src/it/reyboz/bustorino/ActivityFavorites.java
+++ b/src/it/reyboz/bustorino/ActivityFavorites.java
@@ -24,8 +24,8 @@
import it.reyboz.bustorino.backend.Stop;
import it.reyboz.bustorino.adapters.StopAdapter;
import it.reyboz.bustorino.middleware.AsyncStopFavoriteAction;
-import it.reyboz.bustorino.middleware.StopsDB;
-import it.reyboz.bustorino.middleware.UserDB;
+import it.reyboz.bustorino.data.StopsDB;
+import it.reyboz.bustorino.data.UserDB;
import android.app.AlertDialog;
import android.content.Context;
@@ -102,21 +102,13 @@
case R.id.action_favourite_entry_delete:
// remove the stop from the favorites in background
- new AsyncStopFavoriteAction(getApplicationContext(), AsyncStopFavoriteAction.Action.REMOVE) {
-
- /**
- * Callback fired when everything was done
- *
- * @param result
- */
+ new AsyncStopFavoriteAction(getApplicationContext(), AsyncStopFavoriteAction.Action.REMOVE, new AsyncStopFavoriteAction.ResultListener() {
@Override
- protected void onPostExecute(Boolean result) {
- super.onPostExecute(result);
-
- // update the favorite list
+ public void doStuffWithResult(Boolean result) {
+ //Update favorites list
createFavoriteList();
}
- }.execute(busStop);
+ }).execute(busStop);
return true;
case R.id.action_rename_bus_stop_username:
diff --git a/src/it/reyboz/bustorino/ActivityMain.java b/src/it/reyboz/bustorino/ActivityMain.java
--- a/src/it/reyboz/bustorino/ActivityMain.java
+++ b/src/it/reyboz/bustorino/ActivityMain.java
@@ -31,7 +31,10 @@
import android.os.Handler;
import androidx.annotation.NonNull;
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
+import androidx.preference.PreferenceManager;
import androidx.work.BackoffPolicy;
import androidx.work.Constraints;
import androidx.work.ExistingPeriodicWorkPolicy;
@@ -49,7 +52,6 @@
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.util.Log;
-import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@@ -62,15 +64,17 @@
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import it.reyboz.bustorino.backend.*;
+import it.reyboz.bustorino.data.DBUpdateWorker;
+import it.reyboz.bustorino.data.DatabaseUpdate;
+import it.reyboz.bustorino.data.UserDB;
import it.reyboz.bustorino.fragments.*;
import it.reyboz.bustorino.middleware.*;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
-public class ActivityMain extends GeneralActivity implements FragmentListener {
+public class ActivityMain extends GeneralActivity implements FragmentListenerMain {
/*
* Layout elements
@@ -80,7 +84,7 @@
private ProgressBar progressBar;
private TextView howDoesItWorkTextView;
private Button hideHintButton;
- private MenuItem actionHelpMenuItem;
+ private MenuItem actionHelpMenuItem, experimentsMenuItem;
private SwipeRefreshLayout swipeRefreshLayout;
private FloatingActionButton floatingActionButton;
private FragmentManager framan;
@@ -146,12 +150,15 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+
framan = getSupportFragmentManager();
final SharedPreferences theShPr = getMainSharedPreferences();
/*
- * Database Access
+ * UI
*/
setContentView(R.layout.activity_main);
+ Toolbar defToolbar = findViewById(R.id.that_toolbar);
+ setSupportActionBar(defToolbar);
busStopSearchByIDEditText = findViewById(R.id.busStopSearchByIDEditText);
busStopSearchByNameEditText = findViewById(R.id.busStopSearchByNameEditText);
progressBar = findViewById(R.id.progressBar);
@@ -248,7 +255,7 @@
//set stop as last succe
fh.setLastSuccessfullySearchedBusStop(nextStop);
*/
- createFragmentForStop(busStopID);
+ requestArrivalsForStopID(busStopID);
}
//Try (hopefully) database update
//TODO: Check if service shows the notification
@@ -318,10 +325,9 @@
}
- /**
+ /*
* Reload bus stop timetable when it's fulled resumed from background.
- */
- /**
+
* @Override protected void onPostResume() {
* super.onPostResume();
* Log.d("ActivityMain", "onPostResume fired. Last successfully bus stop ID: " + fh.getLastSuccessfullySearchedBusStop());
@@ -358,6 +364,17 @@
//TODO: check if current LiveData-bound observer works
if (pendingNearbyStopsRequest)
theHandler.post(new NearbyStopsRequester());
+ ActionBar bar = getSupportActionBar();
+ if(bar!=null) bar.show();
+ else Log.w(DEBUG_TAG, "ACTION BAR IS NULL");
+
+ //check if we can display the experiments or not
+ SharedPreferences shPr = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ boolean exper_On = shPr.getBoolean(getString(R.string.pref_key_experimental), false);
+ //Log.w(DEBUG_TAG, "Preference experimental is "+exper_On);
+ //MenuItem experimentsItem =
+ if (experimentsMenuItem != null)
+ experimentsMenuItem.setVisible(exper_On);
}
@Override
@@ -366,6 +383,10 @@
getMenuInflater().inflate(R.menu.main, menu);
actionHelpMenuItem = menu.findItem(R.id.action_help);
+ experimentsMenuItem = menu.findItem(R.id.action_experiments);
+ SharedPreferences shPr = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ boolean exper_On = shPr.getBoolean(getString(R.string.pref_key_experimental), false);
+ experimentsMenuItem.setVisible(exper_On);
return true;
}
@@ -426,6 +447,9 @@
case R.id.action_settings:
Log.d("MAINBusTO", "Pressed button preferences");
startActivity(new Intent(ActivityMain.this, ActivitySettings.class));
+ return true;
+ case R.id.action_experiments:
+ startActivity(new Intent(this, ActivityPrincipal.class));
}
return super.onOptionsItemSelected(item);
}
@@ -438,7 +462,7 @@
public void onSearchClick(View v) {
if (searchMode == SEARCH_BY_ID) {
String busStopID = busStopSearchByIDEditText.getText().toString();
- createFragmentForStop(busStopID);
+ requestArrivalsForStopID(busStopID);
} else { // searchMode == SEARCH_BY_NAME
String query = busStopSearchByNameEditText.getText().toString();
//new asyncWgetBusStopSuggestions(query, stopsDB, StopsFindersByNameRecursionHelper);
@@ -451,6 +475,7 @@
**/
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case PERMISSION_REQUEST_POSITION:
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
@@ -497,14 +522,14 @@
@Override
- public void createFragmentForStop(String ID) {
+ public void requestArrivalsForStopID(String ID) {
if (ID == null || ID.length() <= 0) {
// we're still in UI thread, no need to mess with Progress
showToastMessage(R.string.insert_bus_stop_number_error, true);
toggleSpinner(false);
} else if (framan.findFragmentById(R.id.resultFrame) instanceof ArrivalsFragment) {
ArrivalsFragment fragment = (ArrivalsFragment) framan.findFragmentById(R.id.resultFrame);
- if (fragment.getStopID() != null && fragment.getStopID().equals(ID)){
+ if (fragment !=null && fragment.getStopID() != null && fragment.getStopID().equals(ID)){
// Run with previous fetchers
//fragment.getCurrentFetchers().toArray()
new AsyncDataDownload(fh,fragment.getCurrentFetchersAsArray()).execute(ID);
@@ -547,7 +572,7 @@
String busStopID = getBusStopIDFromUri(uri);
busStopSearchByIDEditText.setText(busStopID);
- createFragmentForStop(busStopID);
+ requestArrivalsForStopID(busStopID);
}
public void onHideHint(View v) {
@@ -675,57 +700,6 @@
///////////////////////////////// OTHER STUFF //////////////////////////////////////////////////
-
- /**
- * Get the last successfully searched bus stop or NULL
- *
- * @return
- */
- @Override
- public Stop getLastSuccessfullySearchedBusStop() {
- return fh.getLastSuccessfullySearchedBusStop();
- }
-
- /**
- * Get the last successfully searched bus stop ID or NULL
- *
- * @return
- */
- @Override
- public String getLastSuccessfullySearchedBusStopID() {
- Stop stop = getLastSuccessfullySearchedBusStop();
- return stop == null ? null : stop.ID;
- }
-
- /**
- * Update the star "Add to favorite" icon
- */
- @Override
- public void updateStarIconFromLastBusStop() {
-
- // no favorites no party!
- addToFavorites = (ImageButton) findViewById(R.id.addToFavorites);
- if (addToFavorites == null) {
- Log.d("MainActivity", "Why the fuck the star is not here?!");
- return;
- }
-
- // check if there is a last Stop
- String stopID = getLastSuccessfullySearchedBusStopID();
- if (stopID == null) {
- addToFavorites.setVisibility(View.INVISIBLE);
- } else {
- // filled or outline?
- if (isStopInFavorites(stopID)) {
- addToFavorites.setImageResource(R.drawable.ic_star_filled);
- } else {
- addToFavorites.setImageResource(R.drawable.ic_star_outline);
- }
-
- addToFavorites.setVisibility(View.VISIBLE);
- }
- }
-
/**
* Check if the last Bus Stop is in the favorites
*
@@ -746,33 +720,7 @@
/**
* Add the last Stop to favorites
*/
- @Override
- public void toggleLastStopToFavorites() {
- Stop stop = getLastSuccessfullySearchedBusStop();
- if (stop != null) {
- // toggle the status in background
- new AsyncStopFavoriteAction(getApplicationContext(), AsyncStopFavoriteAction.Action.TOGGLE) {
-
- /**
- * Callback fired when the Stop is saved in the favorites
- * @param result
- */
- @Override
- protected void onPostExecute(Boolean result) {
- super.onPostExecute(result);
-
-
- // update the star icon
- updateStarIconFromLastBusStop();
- }
-
- }.execute(stop);
- } else {
- // this case have no sense, but just immediately update the favorite icon
- updateStarIconFromLastBusStop();
- }
- }
@Override
public void showFloatingActionButton(boolean yes) {
@@ -941,20 +889,4 @@
return busStopID;
}
- public void changeStarType(String stopID) {
- if (isStopInFavorites(stopID)) {
- changeStarFilled();
- } else {
- changeStarOutline();
- }
- }
-
- public void changeStarFilled() {
- addToFavorites.setImageResource(R.drawable.ic_star_filled);
- }
-
- public void changeStarOutline() {
- addToFavorites.setImageResource(R.drawable.ic_star_outline);
- }
-
}
\ No newline at end of file
diff --git a/src/it/reyboz/bustorino/ActivityMap.java b/src/it/reyboz/bustorino/ActivityMap.java
--- a/src/it/reyboz/bustorino/ActivityMap.java
+++ b/src/it/reyboz/bustorino/ActivityMap.java
@@ -33,12 +33,11 @@
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
-import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.preference.PreferenceManager;
import it.reyboz.bustorino.middleware.GeneralActivity;
-import it.reyboz.bustorino.middleware.NextGenDB;
+import it.reyboz.bustorino.data.NextGenDB;
import org.osmdroid.api.IMapController;
import org.osmdroid.config.Configuration;
@@ -410,6 +409,7 @@
**/
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case PERMISSION_REQUEST_POSITION:
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
@@ -422,8 +422,8 @@
setOption(LOCATION_PERMISSION_GIVEN, false);
}
break;
- //add other cases for permissions
+ //add other cases for permissions
}
}
}
\ No newline at end of file
diff --git a/src/it/reyboz/bustorino/ActivityPrincipal.java b/src/it/reyboz/bustorino/ActivityPrincipal.java
new file mode 100644
--- /dev/null
+++ b/src/it/reyboz/bustorino/ActivityPrincipal.java
@@ -0,0 +1,126 @@
+package it.reyboz.bustorino;
+
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.MenuItem;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.ActionBarDrawerToggle;
+import androidx.appcompat.widget.Toolbar;
+import androidx.core.app.NavUtils;
+import androidx.core.view.GravityCompat;
+import androidx.drawerlayout.widget.DrawerLayout;
+
+import com.google.android.material.navigation.NavigationView;
+
+import it.reyboz.bustorino.middleware.GeneralActivity;
+
+public class ActivityPrincipal extends GeneralActivity {
+ private DrawerLayout mDrawer;
+ private NavigationView mNavView;
+ private ActionBarDrawerToggle drawerToggle;
+ private final static String DEBUG_TAG="BusTO Act Principal";
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.new_main_activity);
+
+ Toolbar mToolbar = findViewById(R.id.default_toolbar);
+ setSupportActionBar(mToolbar);
+ if (getSupportActionBar()!=null)
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ else Log.w(DEBUG_TAG, "NO ACTION BAR");
+
+
+ mDrawer = findViewById(R.id.drawer_layout);
+ drawerToggle = setupDrawerToggle(mToolbar);
+
+ // Setup toggle to display hamburger icon with nice animation
+ drawerToggle.setDrawerIndicatorEnabled(true);
+
+ drawerToggle.syncState();
+ mDrawer.addDrawerListener(drawerToggle);
+
+ mNavView = findViewById(R.id.nvView);
+
+ setupDrawerContent(mNavView);
+
+
+ }
+ private ActionBarDrawerToggle setupDrawerToggle(Toolbar toolbar) {
+ // NOTE: Make sure you pass in a valid toolbar reference. ActionBarDrawToggle() does not require it
+ // and will not render the hamburger icon without it.
+ return new ActionBarDrawerToggle(this, mDrawer, toolbar, R.string.drawer_open, R.string.drawer_close);
+
+ }
+ private void setupDrawerContent(NavigationView navigationView) {
+ navigationView.setNavigationItemSelectedListener(
+ menuItem -> {
+
+ //selectDrawerItem(menuItem);
+ Log.d(DEBUG_TAG, "pressed item "+menuItem.toString());
+
+ return true;
+
+ });
+
+ }
+
+
+ // `onPostCreate` called when activity start-up is complete after `onStart()`
+ // NOTE 1: Make sure to override the method with only a single `Bundle` argument
+ // Note 2: Make sure you implement the correct `onPostCreate(Bundle savedInstanceState)` method.
+ // There are 2 signatures and only `onPostCreate(Bundle state)` shows the hamburger icon.
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+ // Sync the toggle state after onRestoreInstanceState has occurred.
+ drawerToggle.syncState();
+ }
+
+ @Override
+ public void onConfigurationChanged(@NonNull Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ // Pass any configuration change to the drawer toggles
+ drawerToggle.onConfigurationChanged(newConfig);
+
+ }
+ @Override
+
+ public boolean onOptionsItemSelected(@NonNull MenuItem item) {
+
+ int[] cases = {R.id.nav_arrivals, R.id.nav_favorites_item};
+
+ switch (item.getItemId()){
+ case android.R.id.home:
+ mDrawer.openDrawer(GravityCompat.START);
+ return true;
+
+ case R.id.nav_arrivals:
+ //do something
+ break;
+ default:
+
+ }
+
+ if (drawerToggle.onOptionsItemSelected(item)) {
+
+ return true;
+
+ }
+ return super.onOptionsItemSelected(item);
+
+ }
+
+ @Override
+ public void onBackPressed() {
+ if (mDrawer.isDrawerOpen(GravityCompat.START))
+ mDrawer.closeDrawer(GravityCompat.START);
+ else
+ super.onBackPressed();
+ }
+}
diff --git a/src/it/reyboz/bustorino/BustoApp.java b/src/it/reyboz/bustorino/BustoApp.java
--- a/src/it/reyboz/bustorino/BustoApp.java
+++ b/src/it/reyboz/bustorino/BustoApp.java
@@ -30,7 +30,7 @@
builder.getPluginConfigurationBuilder(DialogConfigurationBuilder.class).setResText(R.string.message_crash)
.setResTheme(R.style.AppTheme)
.setEnabled(true);
-
- ACRA.init(this, builder);
+ if (!it.reyboz.bustorino.BuildConfig.DEBUG)
+ ACRA.init(this, builder);
}
}
diff --git a/src/it/reyboz/bustorino/adapters/ArrivalsStopAdapter.java b/src/it/reyboz/bustorino/adapters/ArrivalsStopAdapter.java
--- a/src/it/reyboz/bustorino/adapters/ArrivalsStopAdapter.java
+++ b/src/it/reyboz/bustorino/adapters/ArrivalsStopAdapter.java
@@ -19,6 +19,7 @@
import android.content.Context;
import android.location.Location;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.util.Pair;
import androidx.recyclerview.widget.RecyclerView;
@@ -27,9 +28,10 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
+
import it.reyboz.bustorino.R;
import it.reyboz.bustorino.backend.*;
-import it.reyboz.bustorino.fragments.FragmentListener;
+import it.reyboz.bustorino.fragments.FragmentListenerMain;
import it.reyboz.bustorino.util.RoutePositionSorter;
import it.reyboz.bustorino.util.StopSorterByDistance;
@@ -39,13 +41,13 @@
private final static int layoutRes = R.layout.arrivals_nearby_card;
//private List<Stop> stops;
private @Nullable Location userPosition;
- private FragmentListener listener;
+ private FragmentListenerMain listener;
private List< Pair<Stop, Route> > routesPairList = new ArrayList<>();
- private Context context;
+ private final Context context;
//Maximum number of stops to keep
private final int MAX_STOPS = 20; //TODO: make it programmable
- public ArrivalsStopAdapter(@Nullable List< Pair<Stop, Route> > routesPairList, FragmentListener fragmentListener, Context con, @Nullable Location pos) {
+ public ArrivalsStopAdapter(@Nullable List< Pair<Stop, Route> > routesPairList, FragmentListenerMain fragmentListener, Context con, @Nullable Location pos) {
listener = fragmentListener;
userPosition = pos;
this.routesPairList = routesPairList;
@@ -65,11 +67,11 @@
}
@Override
- public void onBindViewHolder(ViewHolder holder, int position) {
+ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
//DO THE ACTUAL WORK TO PUT THE DATA
if(routesPairList==null || routesPairList.size() == 0) return; //NO STOPS
final Pair<Stop,Route> stopRoutePair = routesPairList.get(position);
- if(stopRoutePair!=null){
+ if(stopRoutePair!=null && stopRoutePair.first!=null){
final Stop stop = stopRoutePair.first;
final Route r = stopRoutePair.second;
final Double distance = stop.getDistanceFromLocation(userPosition);
@@ -81,7 +83,15 @@
final String stopText = String.format(context.getResources().getString(R.string.two_strings_format),stop.getStopDisplayName(),stop.ID);
holder.stopNameView.setText(stopText);
//final String routeName = String.format(context.getResources().getString(R.string.two_strings_format),r.getNameForDisplay(),r.destinazione);
- holder.lineNameTextView.setText(r.getNameForDisplay());
+ if (r!=null) {
+ holder.lineNameTextView.setText(r.getNameForDisplay());
+ holder.lineDirectionTextView.setText(r.destinazione);
+ holder.arrivalsTextView.setText(r.getPassaggiToString(0,2,true));
+ } else {
+ holder.lineNameTextView.setVisibility(View.INVISIBLE);
+ holder.lineDirectionTextView.setVisibility(View.INVISIBLE);
+ //holder.arrivalsTextView.setVisibility(View.INVISIBLE);
+ }
/* EXPERIMENTS
if(r.destinazione==null || r.destinazione.trim().isEmpty()){
holder.lineDirectionTextView.setVisibility(View.GONE);
@@ -96,8 +106,6 @@
}
*/
- holder.lineDirectionTextView.setText(r.destinazione);
- holder.arrivalsTextView.setText(r.getPassaggiToString(0,2,true));
holder.stopID =stop.ID;
} else {
Log.w("SquareStopAdapter","!! The selected stop is null !!");
@@ -131,7 +139,7 @@
@Override
public void onClick(View v) {
- listener.createFragmentForStop(stopID);
+ listener.requestArrivalsForStopID(stopID);
}
}
@@ -155,15 +163,61 @@
this.userPosition = userPosition;
}
- public void setRoutesPairListAndPosition(List<Pair<Stop, Route>> routesPairList, @Nullable Location pos) {
- if(routesPairList!=null)
- this.routesPairList = routesPairList;
+ public void setRoutesPairListAndPosition(List<Pair<Stop, Route>> mRoutesPairList, @Nullable Location pos) {
if(pos!=null){
this.userPosition = pos;
}
- resetListAndPosition();
+ if(mRoutesPairList!=null){
+ //this.routesPairList = routesPairList;
+ //remove duplicates
+ sortAndRemoveDuplicates(mRoutesPairList, this.userPosition);
+ //routesPairList = mRoutesPairList;
+ //STUPID CODE
+ if (this.routesPairList == null || routesPairList.size() == 0){
+ routesPairList = mRoutesPairList;
+ notifyDataSetChanged();
+ } else{
+
+ final HashMap<Pair<String,String>, Integer> indexMapIn = getRouteIndexMap(mRoutesPairList);
+ final HashMap<Pair<String,String>, Integer> indexMapExisting = getRouteIndexMap(routesPairList);
+ //List<Pair<Stop,Route>> oldList = routesPairList;
+ routesPairList = mRoutesPairList;
+ /*
+ for (Pair<String,String> pair: indexMapIn.keySet()){
+ final Integer posIn = indexMapIn.get(pair);
+ if (posIn == null) continue;
+ if (indexMapExisting.containsKey(pair)){
+ final Integer posExisting = indexMapExisting.get(pair);
+ //THERE IS ALREADY
+ //routesPairList.remove(posExisting.intValue());
+ //routesPairList.add(posIn,mRoutesPairList.get(posIn));
+
+ notifyItemMoved(posExisting, posIn);
+ indexMapExisting.remove(pair);
+ } else{
+ //INSERT IT
+ //routesPairList.add(posIn,mRoutesPairList.get(posIn));
+ notifyItemInserted(posIn);
+ }
+ }//
+ //REMOVE OLD STOPS
+ for (Pair<String,String> pair: indexMapExisting.keySet()) {
+ final Integer posExisting = indexMapExisting.get(pair);
+ if (posExisting == null) continue;
+ //routesPairList.remove(posExisting.intValue());
+ notifyItemRemoved(posExisting);
+ }
+ //*/notifyDataSetChanged();
+
+ }
+ //remove and join the
+ }
}
+
+ /**
+ * Sort and remove the repetitions for the routesPairList
+ */
private void resetListAndPosition(){
Collections.sort(this.routesPairList,new RoutePositionSorter(userPosition));
//All of this to get only the first occurrences of a line (name & direction)
@@ -171,15 +225,48 @@
Set<Pair<String,String>> allRoutesDirections = new HashSet<>();
while(iterator.hasNext()){
final Pair<Stop,Route> stopRoutePair = iterator.next();
- final Pair<String,String> routeNameDirection = new Pair<>(stopRoutePair.second.getName(),stopRoutePair.second.destinazione);
- if(allRoutesDirections.contains(routeNameDirection)){
- iterator.remove();
- } else {
- allRoutesDirections.add(routeNameDirection);
+ if (stopRoutePair.second != null) {
+ final Pair<String, String> routeNameDirection = new Pair<>(stopRoutePair.second.getName(), stopRoutePair.second.destinazione);
+ if (allRoutesDirections.contains(routeNameDirection)) {
+ iterator.remove();
+ } else {
+ allRoutesDirections.add(routeNameDirection);
+ }
+ }
+ }
+ }
+ /**
+ * Sort and remove the repetitions in the list
+ */
+ private static void sortAndRemoveDuplicates(List< Pair<Stop, Route> > routesPairList, Location positionToSort ){
+ Collections.sort(routesPairList,new RoutePositionSorter(positionToSort));
+ //All of this to get only the first occurrences of a line (name & direction)
+ ListIterator<Pair<Stop,Route>> iterator = routesPairList.listIterator();
+ Set<Pair<String,String>> allRoutesDirections = new HashSet<>();
+ while(iterator.hasNext()){
+ final Pair<Stop,Route> stopRoutePair = iterator.next();
+ if (stopRoutePair.second != null) {
+ final Pair<String, String> routeNameDirection = new Pair<>(stopRoutePair.second.getName(), stopRoutePair.second.destinazione);
+ if (allRoutesDirections.contains(routeNameDirection)) {
+ iterator.remove();
+ } else {
+ allRoutesDirections.add(routeNameDirection);
+ }
}
}
}
-
+ private static HashMap<Pair<String, String>, Integer> getRouteIndexMap(List<Pair<Stop, Route>> routesPairList){
+ final HashMap<Pair<String, String>, Integer> myMap = new HashMap<>();
+ for (int i=0; i<routesPairList.size(); i++){
+ final Route r = routesPairList.get(i).second;
+ if (r==null) continue;
+ final String name = r.getName();
+ final String destination = r.destinazione;
+ if (name!= null && destination!=null)
+ myMap.put(new Pair<>(name.toLowerCase(Locale.ROOT).trim(),destination.toLowerCase(Locale.ROOT).trim()), i);
+ }
+ return myMap;
+ }
}
diff --git a/src/it/reyboz/bustorino/adapters/SquareStopAdapter.java b/src/it/reyboz/bustorino/adapters/SquareStopAdapter.java
--- a/src/it/reyboz/bustorino/adapters/SquareStopAdapter.java
+++ b/src/it/reyboz/bustorino/adapters/SquareStopAdapter.java
@@ -28,7 +28,7 @@
import it.reyboz.bustorino.R;
import it.reyboz.bustorino.backend.Stop;
import it.reyboz.bustorino.util.StopSorterByDistance;
-import it.reyboz.bustorino.fragments.FragmentListener;
+import it.reyboz.bustorino.fragments.FragmentListenerMain;
import java.util.Collections;
import java.util.List;
@@ -37,10 +37,10 @@
private final static int layoutRes = R.layout.stop_card;
//private List<Stop> stops;
private @Nullable Location userPosition;
- private FragmentListener listener;
+ private FragmentListenerMain listener;
private List<Stop> stops;
- public SquareStopAdapter(@Nullable List<Stop> stopList, FragmentListener fragmentListener, @Nullable Location pos) {
+ public SquareStopAdapter(@Nullable List<Stop> stopList, FragmentListenerMain fragmentListener, @Nullable Location pos) {
listener = fragmentListener;
userPosition = pos;
stops = stopList;
@@ -107,7 +107,7 @@
@Override
public void onClick(View v) {
- listener.createFragmentForStop(stopID);
+ listener.requestArrivalsForStopID(stopID);
}
}
diff --git a/src/it/reyboz/bustorino/backend/GTTJSONFetcher.java b/src/it/reyboz/bustorino/backend/GTTJSONFetcher.java
--- a/src/it/reyboz/bustorino/backend/GTTJSONFetcher.java
+++ b/src/it/reyboz/bustorino/backend/GTTJSONFetcher.java
@@ -18,6 +18,8 @@
package it.reyboz.bustorino.backend;
+import android.util.Log;
+
import androidx.annotation.NonNull;
import org.json.JSONArray;
@@ -26,9 +28,11 @@
import java.net.URL;
import java.net.URLEncoder;
+import java.util.HashMap;
import java.util.concurrent.atomic.AtomicReference;
public class GTTJSONFetcher implements ArrivalsFetcher {
+ private final String DEBUG_TAG = "GTTJSONFetcher-BusTO";
@Override @NonNull
public Palina ReadArrivalTimesAll(String stopID, AtomicReference<result> res) {
URL url;
@@ -42,21 +46,28 @@
JSONArray passaggi;
try {
- url = new URL("http://www.gtt.to.it/cms/index.php?option=com_gtt&task=palina.getTransitiOld&palina=" + URLEncoder.encode(stopID, "utf-8") + "&realtime=true");
+ url = new URL("https://www.gtt.to.it/cms/index.php?option=com_gtt&task=palina.getTransitiOld&palina=" + URLEncoder.encode(stopID, "utf-8") + "&bacino=U&realtime=true&get_param=value");
} catch (Exception e) {
res.set(result.PARSER_ERROR);
return p;
}
+ HashMap<String, String> headers = new HashMap<>();
+ //headers.put("Referer","https://www.gtt.to.it/cms/percorari/urbano?view=percorsi&bacino=U&linea=15&Regol=GE");
+ headers.put("Host", "www.gtt.to.it");
- content = networkTools.queryURL(url, res);
+ content = networkTools.queryURL(url, res, headers);
if(content == null) {
+ Log.w("GTTJSONFetcher", "NULL CONTENT");
return p;
}
try {
json = new JSONArray(content);
} catch(JSONException e) {
+ Log.w(DEBUG_TAG, "Error parsing JSON: \n"+content);
+ Log.w(DEBUG_TAG, e);
res.set(result.PARSER_ERROR);
+
return p;
}
@@ -64,6 +75,7 @@
// returns [{"PassaggiRT":[],"Passaggi":[]}] for non existing stops!
json.getJSONObject(0).getString("Linea"); // if we can get this, then there's something useful in the array.
} catch(JSONException e) {
+ Log.w(DEBUG_TAG, "No existing lines");
res.set(result.EMPTY_RESULT_SET);
return p;
}
diff --git a/src/it/reyboz/bustorino/backend/RealtimeVehicle.java b/src/it/reyboz/bustorino/backend/RealtimeVehicle.java
new file mode 100644
--- /dev/null
+++ b/src/it/reyboz/bustorino/backend/RealtimeVehicle.java
@@ -0,0 +1,66 @@
+package it.reyboz.bustorino.backend;
+
+import org.osmdroid.util.GeoPoint;
+
+public class RealtimeVehicle {
+
+ private final GeoPoint location;
+ private final float bearing;
+ public final int updateTimestamp;
+
+ private final String vehicleLabel;
+ private String routeID;
+
+ public RealtimeVehicle(GeoPoint location, float bearing, int updateTimestamp, String vehicleLabel) {
+ this.location = location;
+ this.bearing = bearing;
+ this.updateTimestamp = updateTimestamp;
+ this.vehicleLabel = vehicleLabel;
+ }
+
+ public GeoPoint getLocation() {
+ return location;
+ }
+
+ public float getBearing() {
+ return bearing;
+ }
+
+ public String getVehicleLabel() {
+ return vehicleLabel;
+ }
+
+ public String getRouteID() {
+ return routeID;
+ }
+
+ public void setRouteID(String routeID) {
+ this.routeID = routeID;
+ }
+ /*public enum OccupancyStatus {
+ ABOUT(1),
+ CODING(2),
+ DATABASES(3);
+
+ private final int value;
+ private static final HashMap<Integer,OccupancyStatus> map = new HashMap<>();
+
+ private OccupancyStatus(int value) {
+ this.value = value;
+ }
+
+ static {
+ for (OccupancyStatus status : OccupancyStatus.values()) {
+ map.put(status.value, status);
+ }
+ }
+
+ public static OccupancyStatus valueOf(int status) {
+ return map.get(status);
+ }
+
+ public int getValue() {
+ return value;
+ }
+ }*/
+}
diff --git a/src/it/reyboz/bustorino/backend/networkTools.java b/src/it/reyboz/bustorino/backend/networkTools.java
--- a/src/it/reyboz/bustorino/backend/networkTools.java
+++ b/src/it/reyboz/bustorino/backend/networkTools.java
@@ -83,12 +83,13 @@
try {
urlConnection = (HttpURLConnection) url.openConnection();
} catch(IOException e) {
+ //e.printStackTrace();
res.set(Fetcher.result.SERVER_ERROR); // even when offline, urlConnection works fine. WHY.
return null;
}
// TODO: make this configurable?
- urlConnection.setConnectTimeout(5000);
+ urlConnection.setConnectTimeout(3000);
urlConnection.setReadTimeout(10000);
if(headers!= null){
for(String key : headers.keySet()){
@@ -123,15 +124,21 @@
try {
in.close();
- } catch(Exception ignored) {}
+ } catch(IOException ignored) {
+ //ignored.printStackTrace();
+ }
try {
urlConnection.disconnect();
- } catch(Exception ignored) {}
+ } catch(Exception ignored) {
+ //ignored.printStackTrace();
+ }
if(s.length() == 0) {
+ Log.w("NET TOOLS", "string is empty");
return null;
} else {
+ //Log.d("NET TOOLS", s);
return s;
}
}
diff --git a/src/it/reyboz/bustorino/middleware/AppDataProvider.java b/src/it/reyboz/bustorino/data/AppDataProvider.java
rename from src/it/reyboz/bustorino/middleware/AppDataProvider.java
rename to src/it/reyboz/bustorino/data/AppDataProvider.java
--- a/src/it/reyboz/bustorino/middleware/AppDataProvider.java
+++ b/src/it/reyboz/bustorino/data/AppDataProvider.java
@@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package it.reyboz.bustorino.middleware;
+package it.reyboz.bustorino.data;
import android.content.*;
import android.database.Cursor;
@@ -26,7 +26,7 @@
import it.reyboz.bustorino.BuildConfig;
import it.reyboz.bustorino.backend.DBStatusManager;
-import it.reyboz.bustorino.middleware.NextGenDB.Contract.*;
+import it.reyboz.bustorino.data.NextGenDB.Contract.*;
import java.util.List;
@@ -46,7 +46,7 @@
private static final String DEBUG_TAG="AppDataProvider";
private Context con;
private NextGenDB appDBHelper;
- private UserDB udbhelper;
+ private UserDB userDBHelper;
private SQLiteDatabase db;
private DBStatusManager preferences;
public AppDataProvider() {
@@ -185,7 +185,7 @@
public boolean onCreate() {
con = getContext();
appDBHelper = new NextGenDB(getContext());
- udbhelper = new UserDB(getContext());
+ userDBHelper = new UserDB(getContext());
if(con!=null) {
preferences = new DBStatusManager(con,null);
} else {
@@ -232,7 +232,7 @@
case FAVORITES_OP:
final String stopFavSelection = UserDB.getFavoritesColumnNamesAsArray[0]+" = ?";
- db = udbhelper.getReadableDatabase();
+ db = userDBHelper.getReadableDatabase();
Log.d(DEBUG_TAG,"Asked information on Favorites about stop with id "+uri.getLastPathSegment());
return db.query(UserDB.TABLE_NAME,projection,stopFavSelection,new String[]{uri.getLastPathSegment()},null,null,sortOrder);
case STOP_OP:
diff --git a/src/it/reyboz/bustorino/middleware/DBUpdateWorker.java b/src/it/reyboz/bustorino/data/DBUpdateWorker.java
rename from src/it/reyboz/bustorino/middleware/DBUpdateWorker.java
rename to src/it/reyboz/bustorino/data/DBUpdateWorker.java
--- a/src/it/reyboz/bustorino/middleware/DBUpdateWorker.java
+++ b/src/it/reyboz/bustorino/data/DBUpdateWorker.java
@@ -1,7 +1,6 @@
-package it.reyboz.bustorino.middleware;
+package it.reyboz.bustorino.data;
import android.annotation.SuppressLint;
-import android.app.Notification;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
diff --git a/src/it/reyboz/bustorino/middleware/DatabaseUpdate.java b/src/it/reyboz/bustorino/data/DatabaseUpdate.java
rename from src/it/reyboz/bustorino/middleware/DatabaseUpdate.java
rename to src/it/reyboz/bustorino/data/DatabaseUpdate.java
--- a/src/it/reyboz/bustorino/middleware/DatabaseUpdate.java
+++ b/src/it/reyboz/bustorino/data/DatabaseUpdate.java
@@ -1,4 +1,4 @@
-package it.reyboz.bustorino.middleware;
+package it.reyboz.bustorino.data;
import android.content.ContentValues;
import android.content.Context;
diff --git a/src/it/reyboz/bustorino/middleware/DatabaseUpdateService.java b/src/it/reyboz/bustorino/data/DatabaseUpdateService.java
rename from src/it/reyboz/bustorino/middleware/DatabaseUpdateService.java
rename to src/it/reyboz/bustorino/data/DatabaseUpdateService.java
--- a/src/it/reyboz/bustorino/middleware/DatabaseUpdateService.java
+++ b/src/it/reyboz/bustorino/data/DatabaseUpdateService.java
@@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package it.reyboz.bustorino.middleware;
+package it.reyboz.bustorino.data;
import android.app.IntentService;
import android.content.*;
diff --git a/src/it/reyboz/bustorino/middleware/NextGenDB.java b/src/it/reyboz/bustorino/data/NextGenDB.java
rename from src/it/reyboz/bustorino/middleware/NextGenDB.java
rename to src/it/reyboz/bustorino/data/NextGenDB.java
--- a/src/it/reyboz/bustorino/middleware/NextGenDB.java
+++ b/src/it/reyboz/bustorino/data/NextGenDB.java
@@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package it.reyboz.bustorino.middleware;
+package it.reyboz.bustorino.data;
import android.content.ContentValues;
import android.content.Context;
@@ -25,20 +25,14 @@
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;
-import androidx.annotation.Nullable;
import android.util.Log;
-import it.reyboz.bustorino.backend.Fetcher;
-import it.reyboz.bustorino.backend.FiveTAPIFetcher;
import it.reyboz.bustorino.backend.Route;
import it.reyboz.bustorino.backend.Stop;
-import org.json.JSONException;
-import org.json.JSONObject;
import java.util.*;
-import java.util.concurrent.atomic.AtomicReference;
-import static it.reyboz.bustorino.middleware.NextGenDB.Contract.*;
+import static it.reyboz.bustorino.data.NextGenDB.Contract.*;
public class NextGenDB extends SQLiteOpenHelper{
public static final String DATABASE_NAME = "bustodatabase.db";
diff --git a/src/it/reyboz/bustorino/middleware/OldDB.java b/src/it/reyboz/bustorino/data/OldDB.java
rename from src/it/reyboz/bustorino/middleware/OldDB.java
rename to src/it/reyboz/bustorino/data/OldDB.java
--- a/src/it/reyboz/bustorino/middleware/OldDB.java
+++ b/src/it/reyboz/bustorino/data/OldDB.java
@@ -16,14 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package it.reyboz.bustorino.middleware;
+package it.reyboz.bustorino.data;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
-import java.io.File;
-
public class OldDB extends SQLiteOpenHelper {
private static final String DATABASE_NAME_OLD = "bustorino.db";
private int oldVersion = -1;
diff --git a/src/it/reyboz/bustorino/middleware/StopsDB.java b/src/it/reyboz/bustorino/data/StopsDB.java
rename from src/it/reyboz/bustorino/middleware/StopsDB.java
rename to src/it/reyboz/bustorino/data/StopsDB.java
--- a/src/it/reyboz/bustorino/middleware/StopsDB.java
+++ b/src/it/reyboz/bustorino/data/StopsDB.java
@@ -16,7 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package it.reyboz.bustorino.middleware;
+package it.reyboz.bustorino.data;
import android.content.Context;
import android.database.Cursor;
diff --git a/src/it/reyboz/bustorino/middleware/UserDB.java b/src/it/reyboz/bustorino/data/UserDB.java
rename from src/it/reyboz/bustorino/middleware/UserDB.java
rename to src/it/reyboz/bustorino/data/UserDB.java
--- a/src/it/reyboz/bustorino/middleware/UserDB.java
+++ b/src/it/reyboz/bustorino/data/UserDB.java
@@ -16,7 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package it.reyboz.bustorino.middleware;
+package it.reyboz.bustorino.data;
import android.content.ContentValues;
import android.database.Cursor;
@@ -118,11 +118,10 @@
if (len > 0) {
try {
- Stop stopStopStopStopStop;
for (int i = 0; i < len; i++) {
- stopStopStopStopStop = new Stop(ID.get(i));
- stopStopStopStopStop.setStopUserName(username.get(i));
- addOrUpdateStop(stopStopStopStopStop, newdb);
+ final Stop mStop = new Stop(ID.get(i));
+ mStop.setStopUserName(username.get(i));
+ addOrUpdateStop(mStop, newdb);
}
} catch(Exception ignored) {
// partial data is better than no data at all, no transactions here
@@ -278,4 +277,14 @@
return false;
}
}
+ public static boolean checkStopInFavorites(String stopID, Context con){
+ boolean found = false;
+ // no stop no party
+ if (stopID != null) {
+ SQLiteDatabase userDB = new UserDB(con).getReadableDatabase();
+ found = UserDB.isStopInFavorites(userDB, stopID);
+ }
+
+ return found;
+ }
}
diff --git a/src/it/reyboz/bustorino/fragments/ArrivalsFragment.java b/src/it/reyboz/bustorino/fragments/ArrivalsFragment.java
--- a/src/it/reyboz/bustorino/fragments/ArrivalsFragment.java
+++ b/src/it/reyboz/bustorino/fragments/ArrivalsFragment.java
@@ -55,9 +55,11 @@
import it.reyboz.bustorino.backend.Palina;
import it.reyboz.bustorino.backend.Passaggio;
import it.reyboz.bustorino.backend.Route;
-import it.reyboz.bustorino.middleware.AppDataProvider;
-import it.reyboz.bustorino.middleware.NextGenDB;
-import it.reyboz.bustorino.middleware.UserDB;
+import it.reyboz.bustorino.backend.Stop;
+import it.reyboz.bustorino.data.AppDataProvider;
+import it.reyboz.bustorino.data.NextGenDB;
+import it.reyboz.bustorino.data.UserDB;
+import it.reyboz.bustorino.middleware.AsyncStopFavoriteAction;
public class ArrivalsFragment extends ResultListFragment implements LoaderManager.LoaderCallbacks<Cursor> {
@@ -75,7 +77,8 @@
private boolean justCreated = false;
private Palina lastUpdatedPalina = null;
private boolean needUpdateOnAttach = false;
- private boolean requestedNewArrivalTimes = false;
+ private boolean fetchersChangeRequestPending = false;
+ private boolean stopIsInFavorites = false;
//Views
protected ImageButton addToFavorites;
@@ -139,11 +142,13 @@
resultsListView = (ListView) root.findViewById(R.id.resultsListView);
timesSourceTextView = (TextView) root.findViewById(R.id.timesSourceTextView);
timesSourceTextView.setOnLongClickListener(view -> {
- if(!requestedNewArrivalTimes){
+ if(!fetchersChangeRequestPending){
rotateFetchers();
+ //Show we are changing provider
timesSourceTextView.setText(R.string.arrival_source_changing);
- mListener.createFragmentForStop(stopID);
- requestedNewArrivalTimes = true;
+
+ mListener.requestArrivalsForStopID(stopID);
+ fetchersChangeRequestPending = true;
return true;
}
return false;
@@ -156,7 +161,7 @@
addToFavorites.setClickable(true);
addToFavorites.setOnClickListener(v -> {
// add/remove the stop in the favorites
- mListener.toggleLastStopToFavorites();
+ toggleLastStopToFavorites();
});
resultsListView.setOnItemClickListener((parent, view, position, id) -> {
@@ -197,7 +202,7 @@
if(stopID!=null){
//refresh the arrivals
if(!justCreated)
- mListener.createFragmentForStop(stopID);
+ mListener.requestArrivalsForStopID(stopID);
else justCreated = false;
//start the loader
if(prefs.isDBUpdating(true)){
@@ -290,10 +295,18 @@
default:
throw new IllegalStateException("Unexpected value: " + source);
}
+ int count = 0;
+ while (source != fetchers.get(0).getSourceForFetcher() && count < 100){
+ //we need to update the fetcher that is requested
+ rotateFetchers();
+ count++;
+ }
+ if (count>10)
+ Log.w(DEBUG_TAG, "Tried to update the source fetcher but it didn't work");
final String base_message = getString(R.string.times_source_fmt, source_txt);
timesSourceTextView.setVisibility(View.VISIBLE);
timesSourceTextView.setText(base_message);
- requestedNewArrivalTimes = false;
+ fetchersChangeRequestPending = false;
}
@Override
@@ -320,9 +333,11 @@
}
// whatever is the case, update the star icon
- mListener.updateStarIconFromLastBusStop();
+ //updateStarIconFromLastBusStop();
+
}
+ @NonNull
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
if(args.getString(KEY_STOP_ID)==null) return null;
@@ -354,13 +369,20 @@
case loaderFavId:
final int colUserName = data.getColumnIndex(UserDB.getFavoritesColumnNamesAsArray[1]);
if(data.getCount()>0){
+ // IT'S IN FAVORITES
data.moveToFirst();
final String probableName = data.getString(colUserName);
+ stopIsInFavorites = true;
if(probableName!=null && !probableName.isEmpty()){
- stopName = probableName;
- updateMessage();
+ stopName = probableName;
+ //update the message in the textview
+ updateMessage();
}
+ } else {
+ stopIsInFavorites =false;
}
+ updateStarIcon();
+
if(stopName == null){
//stop is not inside the favorites and wasn't provided
Log.d("ArrivalsFragment"+getTag(),"Stop wasn't in the favorites and has no name, looking in the DB");
@@ -392,4 +414,71 @@
public void onLoaderReset(Loader<Cursor> loader) {
//NOTHING TO DO
}
+
+
+ public void toggleLastStopToFavorites() {
+
+ Stop stop = lastUpdatedPalina;
+ if (stop != null) {
+
+ // toggle the status in background
+ new AsyncStopFavoriteAction(getContext().getApplicationContext(), AsyncStopFavoriteAction.Action.TOGGLE,
+ v->updateStarIconFromLastBusStop(v)).execute(stop);
+ } else {
+ // this case have no sense, but just immediately update the favorite icon
+ updateStarIconFromLastBusStop(true);
+ }
+ }
+ /**
+ * Update the star "Add to favorite" icon
+ */
+ public void updateStarIconFromLastBusStop(Boolean toggleDone) {
+ if (stopIsInFavorites)
+ stopIsInFavorites = !toggleDone;
+ else stopIsInFavorites = toggleDone;
+
+ updateStarIcon();
+
+ // check if there is a last Stop
+ /*
+ if (stopID == null) {
+ addToFavorites.setVisibility(View.INVISIBLE);
+ } else {
+ // filled or outline?
+ if (isStopInFavorites(stopID)) {
+ addToFavorites.setImageResource(R.drawable.ic_star_filled);
+ } else {
+ addToFavorites.setImageResource(R.drawable.ic_star_outline);
+ }
+
+ addToFavorites.setVisibility(View.VISIBLE);
+ }
+ */
+ }
+
+ /**
+ * Update the star icon according to `stopIsInFavorites`
+ */
+ public void updateStarIcon() {
+
+ // no favorites no party!
+
+ // check if there is a last Stop
+
+ if (stopID == null) {
+ addToFavorites.setVisibility(View.INVISIBLE);
+ } else {
+ // filled or outline?
+ if (stopIsInFavorites) {
+ addToFavorites.setImageResource(R.drawable.ic_star_filled);
+ } else {
+ addToFavorites.setImageResource(R.drawable.ic_star_outline);
+ }
+
+ addToFavorites.setVisibility(View.VISIBLE);
+ }
+
+
+ }
+
}
diff --git a/src/it/reyboz/bustorino/fragments/BaseFragment.java b/src/it/reyboz/bustorino/fragments/BaseFragment.java
new file mode 100644
--- /dev/null
+++ b/src/it/reyboz/bustorino/fragments/BaseFragment.java
@@ -0,0 +1,45 @@
+package it.reyboz.bustorino.fragments;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Toast;
+
+import androidx.fragment.app.Fragment;
+
+import it.reyboz.bustorino.BuildConfig;
+
+import static android.content.Context.MODE_PRIVATE;
+
+public abstract class BaseFragment extends Fragment {
+
+ protected String PREF_FILE= BuildConfig.APPLICATION_ID+".fragment_prefs";
+
+ protected void setOption(String optionName, boolean value) {
+ Context mContext = getContext();
+ SharedPreferences.Editor editor = mContext.getSharedPreferences(PREF_FILE, MODE_PRIVATE).edit();
+ editor.putBoolean(optionName, value);
+ editor.commit();
+ }
+
+ protected boolean getOption(String optionName, boolean optDefault) {
+ Context mContext = getContext();
+ SharedPreferences preferences = mContext.getSharedPreferences(PREF_FILE, MODE_PRIVATE);
+ return preferences.getBoolean(optionName, optDefault);
+ }
+
+ protected void showToastMessage(int messageID, boolean short_lenght) {
+ final int length = short_lenght ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG;
+ Toast.makeText(getContext(), messageID, length).show();
+ }
+
+ public void hideKeyboard() {
+ View view = getActivity().getCurrentFocus();
+ if (view != null) {
+ ((InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE))
+ .hideSoftInputFromWindow(view.getWindowToken(),
+ InputMethodManager.HIDE_NOT_ALWAYS);
+ }
+ }
+}
diff --git a/src/it/reyboz/bustorino/fragments/CommonFragmentListener.java b/src/it/reyboz/bustorino/fragments/CommonFragmentListener.java
new file mode 100644
--- /dev/null
+++ b/src/it/reyboz/bustorino/fragments/CommonFragmentListener.java
@@ -0,0 +1,24 @@
+package it.reyboz.bustorino.fragments;
+
+public interface CommonFragmentListener {
+
+
+ /**
+ * Tell the activity that we need to disable/enable its floatingActionButton
+ * @param yes or no
+ */
+ void showFloatingActionButton(boolean yes);
+
+ /**
+ * Sends the message to the activity to adapt the GUI
+ * to the fragment that has been attached
+ * @param fragmentType the type of fragment attached
+ */
+ void readyGUIfor(FragmentKind fragmentType);
+ /**
+ * Houston, we need another fragment!
+ *
+ * @param ID the Stop ID
+ */
+ void requestArrivalsForStopID(String ID);
+}
diff --git a/src/it/reyboz/bustorino/fragments/CommonScrollListener.java b/src/it/reyboz/bustorino/fragments/CommonScrollListener.java
--- a/src/it/reyboz/bustorino/fragments/CommonScrollListener.java
+++ b/src/it/reyboz/bustorino/fragments/CommonScrollListener.java
@@ -25,12 +25,12 @@
public class CommonScrollListener extends RecyclerView.OnScrollListener implements AbsListView.OnScrollListener{
- WeakReference<FragmentListener> listenerWeakReference;
+ WeakReference<FragmentListenerMain> listenerWeakReference;
//enable swipeRefreshLayout when scrolling down or not
boolean enableRefreshLayout;
int lastvisibleitem;
- public CommonScrollListener(FragmentListener lis,boolean enableRefreshLayout){
+ public CommonScrollListener(FragmentListenerMain lis, boolean enableRefreshLayout){
listenerWeakReference = new WeakReference<>(lis);
this.enableRefreshLayout = enableRefreshLayout;
}
@@ -43,7 +43,7 @@
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
- FragmentListener listener = listenerWeakReference.get();
+ FragmentListenerMain listener = listenerWeakReference.get();
if(listener==null){
//can't do anything, sorry
Log.i(this.getClass().getName(),"called onScroll but FragmentListener is null");
@@ -77,7 +77,7 @@
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
- FragmentListener listener = listenerWeakReference.get();
+ FragmentListenerMain listener = listenerWeakReference.get();
if(newState!=SCROLL_STATE_IDLE) listener.showFloatingActionButton(false);
else listener.showFloatingActionButton(true);
diff --git a/src/it/reyboz/bustorino/fragments/FragmentHelper.java b/src/it/reyboz/bustorino/fragments/FragmentHelper.java
--- a/src/it/reyboz/bustorino/fragments/FragmentHelper.java
+++ b/src/it/reyboz/bustorino/fragments/FragmentHelper.java
@@ -27,10 +27,10 @@
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.util.Log;
import it.reyboz.bustorino.R;
-import it.reyboz.bustorino.adapters.PalinaAdapter;
import it.reyboz.bustorino.backend.Fetcher;
import it.reyboz.bustorino.backend.Palina;
import it.reyboz.bustorino.backend.Stop;
+import it.reyboz.bustorino.data.NextGenDB;
import it.reyboz.bustorino.middleware.*;
import java.lang.ref.WeakReference;
@@ -43,7 +43,9 @@
GeneralActivity act;
private Stop lastSuccessfullySearchedBusStop;
//support for multiple frames
- private int primaryFrameLayout,secondaryFrameLayout, swipeRefID;
+ private final int secondaryFrameLayout;
+ private final int swipeRefID;
+ private final int primaryFrameLayout;
public static final int NO_FRAME = -3;
private WeakReference<AsyncDataDownload> lastTaskRef;
private NextGenDB newDBHelper;
@@ -94,8 +96,8 @@
FragmentManager fm = act.getSupportFragmentManager();
- if(fm.findFragmentById(R.id.resultFrame) instanceof ArrivalsFragment) {
- arrivalsFragment = (ArrivalsFragment) fm.findFragmentById(R.id.resultFrame);
+ if(fm.findFragmentById(primaryFrameLayout) instanceof ArrivalsFragment) {
+ arrivalsFragment = (ArrivalsFragment) fm.findFragmentById(primaryFrameLayout);
sameFragment = arrivalsFragment.isFragmentForTheSameStop(p);
} else
sameFragment = false;
@@ -115,7 +117,7 @@
attachFragmentToContainer(fm,arrivalsFragment,true,ResultListFragment.getFragmentTag(p));
} else {
Log.d("BusTO", "Same bus stop, accessing existing fragment");
- arrivalsFragment = (ArrivalsFragment) fm.findFragmentById(R.id.resultFrame);
+ arrivalsFragment = (ArrivalsFragment) fm.findFragmentById(primaryFrameLayout);
}
// DO NOT CALL `setListAdapter` ever on arrivals fragment
arrivalsFragment.updateFragmentData(p);
@@ -143,8 +145,8 @@
* @param on new status of spinner system
*/
public void toggleSpinner(boolean on){
- if (act instanceof FragmentListener)
- ((FragmentListener) act).toggleSpinner(on);
+ if (act instanceof FragmentListenerMain)
+ ((FragmentListenerMain) act).toggleSpinner(on);
else {
SwipeRefreshLayout srl = (SwipeRefreshLayout) act.findViewById(swipeRefID);
srl.setRefreshing(false);
diff --git a/src/it/reyboz/bustorino/fragments/FragmentListener.java b/src/it/reyboz/bustorino/fragments/FragmentListenerMain.java
rename from src/it/reyboz/bustorino/fragments/FragmentListener.java
rename to src/it/reyboz/bustorino/fragments/FragmentListenerMain.java
--- a/src/it/reyboz/bustorino/fragments/FragmentListener.java
+++ b/src/it/reyboz/bustorino/fragments/FragmentListenerMain.java
@@ -19,50 +19,18 @@
import it.reyboz.bustorino.backend.Stop;
-public interface FragmentListener {
- void toggleSpinner(boolean state);
- /**
- * Sends the message to the activity to adapt the GUI
- * to the fragment that has been attached
- * @param fragmentType the type of fragment attached
- */
- void readyGUIfor(FragmentKind fragmentType);
- /**
- * Houston, we need another fragment!
- *
- * @param ID the Stop ID
- */
- void createFragmentForStop(String ID);
+public interface FragmentListenerMain extends CommonFragmentListener {
- /**
- * Add the last successfully searched stop to the favorites
- */
- void toggleLastStopToFavorites();
+ void toggleSpinner(boolean state);
- /**
- * Get the last successfully searched bus stop or NULL
- *
- * @return
- */
- Stop getLastSuccessfullySearchedBusStop();
- /**
- * Get the last successfully searched bus stop ID or NULL
- *
- * @return
+ /*
+ Unused method
+ * Add the last successfully searched stop to the favorites
*/
- String getLastSuccessfullySearchedBusStopID();
- /**
- * Automatically update the "Add to favorite" star icon
- */
- void updateStarIconFromLastBusStop();
+ //void toggleLastStopToFavorites();
- /**
- * Tell the activity that we need to disable/enable its floatingActionButton
- * @param yes or no
- */
- void showFloatingActionButton(boolean yes);
/**
* Tell activity that we need to enable/disable the refreshLayout
diff --git a/src/it/reyboz/bustorino/fragments/MainScreenFragment.java b/src/it/reyboz/bustorino/fragments/MainScreenFragment.java
new file mode 100644
--- /dev/null
+++ b/src/it/reyboz/bustorino/fragments/MainScreenFragment.java
@@ -0,0 +1,308 @@
+package it.reyboz.bustorino.fragments;
+
+import android.content.Context;
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
+
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import com.google.zxing.integration.android.IntentIntegrator;
+import it.reyboz.bustorino.R;
+import it.reyboz.bustorino.backend.ArrivalsFetcher;
+import it.reyboz.bustorino.backend.FiveTAPIFetcher;
+import it.reyboz.bustorino.backend.FiveTScraperFetcher;
+import it.reyboz.bustorino.backend.FiveTStopsFetcher;
+import it.reyboz.bustorino.backend.GTTJSONFetcher;
+import it.reyboz.bustorino.backend.GTTStopsFetcher;
+import it.reyboz.bustorino.backend.Stop;
+import it.reyboz.bustorino.backend.StopsFinderByName;
+import it.reyboz.bustorino.data.UserDB;
+import it.reyboz.bustorino.middleware.AsyncDataDownload;
+
+
+/**
+ * A simple {@link Fragment} subclass.
+ * Use the {@link MainScreenFragment#newInstance} factory method to
+ * create an instance of this fragment.
+ */
+public class MainScreenFragment extends BaseFragment implements FragmentListenerMain{
+
+
+ private final String OPTION_SHOW_LEGEND = "show_legend";
+
+ private static final String DEBUG_TAG = "BusTO - MainFragment";
+
+ private CommonFragmentListener mListener;
+ /// UI ELEMENTS //
+ private ImageButton addToFavorites;
+ private FragmentHelper fragmentHelper;
+ private SwipeRefreshLayout swipeRefreshLayout;
+ private EditText busStopSearchByIDEditText;
+ private EditText busStopSearchByNameEditText;
+ private ProgressBar progressBar;
+ private TextView howDoesItWorkTextView;
+ private Button hideHintButton;
+ private MenuItem actionHelpMenuItem;
+ private FloatingActionButton floatingActionButton;
+ //private Snackbar snackbar;
+ /*
+ * Search mode
+ */
+ private static final int SEARCH_BY_NAME = 0;
+ private static final int SEARCH_BY_ID = 1;
+ private static final int SEARCH_BY_ROUTE = 2; // TODO: implement this -- https://gitpull.it/T12
+ private int searchMode;
+ //private ImageButton addToFavorites;
+ private final ArrivalsFetcher[] arrivalsFetchers = new ArrivalsFetcher[]{new FiveTAPIFetcher(), new GTTJSONFetcher(), new FiveTScraperFetcher()};
+
+
+ public MainScreenFragment() {
+ // Required empty public constructor
+ }
+
+
+ public static MainScreenFragment newInstance() {
+ MainScreenFragment fragment = new MainScreenFragment();
+ Bundle args = new Bundle();
+ //args.putString(ARG_PARAM1, param1);
+ //args.putString(ARG_PARAM2, param2);
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (getArguments() != null) {
+ //do nothing
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ View root = inflater.inflate(R.layout.fragment_main_screen, container, false);
+ addToFavorites = (ImageButton) root.findViewById(R.id.addToFavorites);
+ busStopSearchByIDEditText = root.findViewById(R.id.busStopSearchByIDEditText);
+ busStopSearchByNameEditText = root.findViewById(R.id.busStopSearchByNameEditText);
+ progressBar = root.findViewById(R.id.progressBar);
+ howDoesItWorkTextView = root.findViewById(R.id.howDoesItWorkTextView);
+ hideHintButton = root.findViewById(R.id.hideHintButton);
+ swipeRefreshLayout = root.findViewById(R.id.listRefreshLayout);
+ floatingActionButton = root.findViewById(R.id.floatingActionButton);
+ return root;
+ }
+
+
+
+ /*
+ GUI METHODS
+ */
+ /**
+ * QR scan button clicked
+ *
+ * @param v View QRButton clicked
+ */
+ public void onQRButtonClick(View v) {
+ IntentIntegrator integrator = new IntentIntegrator(getActivity());
+ integrator.initiateScan();
+ }
+ public void onHideHint(View v) {
+
+ hideHints();
+ setOption(OPTION_SHOW_LEGEND, false);
+ }
+ /**
+ * OK this is pure shit
+ *
+ * @param v View clicked
+ */
+ public void onSearchClick(View v) {
+ final StopsFinderByName[] stopsFinderByNames = new StopsFinderByName[]{new GTTStopsFetcher(), new FiveTStopsFetcher()};
+ if (searchMode == SEARCH_BY_ID) {
+ String busStopID = busStopSearchByIDEditText.getText().toString();
+ requestArrivalsForStopID(busStopID);
+ } else { // searchMode == SEARCH_BY_NAME
+ String query = busStopSearchByNameEditText.getText().toString();
+ //new asyncWgetBusStopSuggestions(query, stopsDB, StopsFindersByNameRecursionHelper);
+ new AsyncDataDownload(fragmentHelper, stopsFinderByNames).execute(query);
+ }
+ }
+
+
+ public void onToggleKeyboardLayout(View v) {
+
+ if (searchMode == SEARCH_BY_NAME) {
+ setSearchModeBusStopID();
+ if (busStopSearchByIDEditText.requestFocus()) {
+ showKeyboard();
+ }
+ } else { // searchMode == SEARCH_BY_ID
+ setSearchModeBusStopName();
+ if (busStopSearchByNameEditText.requestFocus()) {
+ showKeyboard();
+ }
+ }
+
+ }
+ @Override
+ public void enableRefreshLayout(boolean yes) {
+ swipeRefreshLayout.setEnabled(yes);
+ }
+
+ ////////////////////////////////////// GUI HELPERS /////////////////////////////////////////////
+
+ public void showKeyboard() {
+ InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
+ View view = searchMode == SEARCH_BY_ID ? busStopSearchByIDEditText : busStopSearchByNameEditText;
+ imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
+ }
+
+ private void setSearchModeBusStopID() {
+ searchMode = SEARCH_BY_ID;
+ busStopSearchByNameEditText.setVisibility(View.GONE);
+ busStopSearchByNameEditText.setText("");
+ busStopSearchByIDEditText.setVisibility(View.VISIBLE);
+ floatingActionButton.setImageResource(R.drawable.alphabetical);
+ }
+
+ private void setSearchModeBusStopName() {
+ searchMode = SEARCH_BY_NAME;
+ busStopSearchByIDEditText.setVisibility(View.GONE);
+ busStopSearchByIDEditText.setText("");
+ busStopSearchByNameEditText.setVisibility(View.VISIBLE);
+ floatingActionButton.setImageResource(R.drawable.numeric);
+ }
+
+ /**
+ * Having that cursor at the left of the edit text makes me cancer.
+ *
+ * @param busStopID bus stop ID
+ */
+ private void setBusStopSearchByIDEditText(String busStopID) {
+ busStopSearchByIDEditText.setText(busStopID);
+ busStopSearchByIDEditText.setSelection(busStopID.length());
+ }
+
+ private void showHints() {
+ howDoesItWorkTextView.setVisibility(View.VISIBLE);
+ hideHintButton.setVisibility(View.VISIBLE);
+ actionHelpMenuItem.setVisible(false);
+ }
+
+ private void hideHints() {
+ howDoesItWorkTextView.setVisibility(View.GONE);
+ hideHintButton.setVisibility(View.GONE);
+ actionHelpMenuItem.setVisible(true);
+ }
+
+ //TODO: toggle spinner from mainActivity
+ @Override
+ public void toggleSpinner(boolean enable) {
+ if (enable) {
+ //already set by the RefreshListener when needed
+ //swipeRefreshLayout.setRefreshing(true);
+ progressBar.setVisibility(View.VISIBLE);
+ } else {
+ swipeRefreshLayout.setRefreshing(false);
+ progressBar.setVisibility(View.GONE);
+ }
+ }
+
+
+ private void prepareGUIForBusLines() {
+ swipeRefreshLayout.setEnabled(true);
+ swipeRefreshLayout.setVisibility(View.VISIBLE);
+ actionHelpMenuItem.setVisible(true);
+ }
+
+ private void prepareGUIForBusStops() {
+ swipeRefreshLayout.setEnabled(false);
+ swipeRefreshLayout.setVisibility(View.VISIBLE);
+ actionHelpMenuItem.setVisible(false);
+ }
+
+
+ @Override
+ public void showFloatingActionButton(boolean yes) {
+ mListener.showFloatingActionButton(yes);
+ }
+
+ /**
+ * This provides a temporary fix to make the transition
+ * to a single asynctask go smoother
+ *
+ * @param fragmentType the type of fragment created
+ */
+ @Override
+ public void readyGUIfor(FragmentKind fragmentType) {
+ throw new UnsupportedOperationException();
+ /*
+ hideKeyboard();
+ //TODO: fix this
+ //if we are getting results, already, stop waiting for nearbyStops
+ if (pendingNearbyStopsRequest && (fragmentType == FragmentKind.ARRIVALS || fragmentType == FragmentKind.STOPS)) {
+ locmgr.removeUpdates(locListener);
+ pendingNearbyStopsRequest = false;
+ }
+
+ if (fragmentType == null) Log.e("ActivityMain", "Problem with fragmentType");
+ else
+ switch (fragmentType) {
+ case ARRIVALS:
+ prepareGUIForBusLines();
+ if (getOption(OPTION_SHOW_LEGEND, true)) {
+ showHints();
+ }
+ break;
+ case STOPS:
+ prepareGUIForBusStops();
+ break;
+ default:
+ Log.e("BusTO Activity", "Called readyGUI with unsupported type of Fragment");
+ return;
+ }
+ // Shows hints
+ */
+
+ }
+
+ @Override
+ public void requestArrivalsForStopID(String ID) {
+ final FragmentManager framan = getChildFragmentManager();
+ if (ID == null || ID.length() <= 0) {
+ // we're still in UI thread, no need to mess with Progress
+ showToastMessage(R.string.insert_bus_stop_number_error, true);
+ toggleSpinner(false);
+ } else if (framan.findFragmentById(R.id.resultFrame) instanceof ArrivalsFragment) {
+ ArrivalsFragment fragment = (ArrivalsFragment) framan.findFragmentById(R.id.resultFrame);
+ if (fragment != null && fragment.getStopID() != null && fragment.getStopID().equals(ID)){
+ // Run with previous fetchers
+ //fragment.getCurrentFetchers().toArray()
+ new AsyncDataDownload(fragmentHelper,fragment.getCurrentFetchersAsArray()).execute(ID);
+ } else{
+ new AsyncDataDownload(fragmentHelper, arrivalsFetchers).execute(ID);
+ }
+ }
+ else {
+ new AsyncDataDownload(fragmentHelper,arrivalsFetchers).execute(ID);
+ Log.d("MainActiv", "Started search for arrivals of stop " + ID);
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/src/it/reyboz/bustorino/fragments/NearbyStopsFragment.java b/src/it/reyboz/bustorino/fragments/NearbyStopsFragment.java
--- a/src/it/reyboz/bustorino/fragments/NearbyStopsFragment.java
+++ b/src/it/reyboz/bustorino/fragments/NearbyStopsFragment.java
@@ -24,6 +24,8 @@
import android.location.Location;
import android.net.Uri;
import android.os.Bundle;
+
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.loader.app.LoaderManager;
@@ -47,8 +49,8 @@
import it.reyboz.bustorino.backend.*;
import it.reyboz.bustorino.backend.FiveTAPIFetcher.QueryType;
import it.reyboz.bustorino.middleware.AppLocationManager;
-import it.reyboz.bustorino.middleware.AppDataProvider;
-import it.reyboz.bustorino.middleware.NextGenDB.Contract.*;
+import it.reyboz.bustorino.data.AppDataProvider;
+import it.reyboz.bustorino.data.NextGenDB.Contract.*;
import it.reyboz.bustorino.adapters.SquareStopAdapter;
import it.reyboz.bustorino.util.LocationCriteria;
import it.reyboz.bustorino.util.StopSorterByDistance;
@@ -57,7 +59,7 @@
public class NearbyStopsFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> {
- private FragmentListener mListener;
+ private FragmentListenerMain mListener;
private FragmentLocationListener fragmentLocationListener;
private final String[] PROJECTION = {StopsTable.COL_ID,StopsTable.COL_LAT,StopsTable.COL_LONG,
StopsTable.COL_NAME,StopsTable.COL_TYPE,StopsTable.COL_LINES_STOPPING};
@@ -215,8 +217,8 @@
@Override
public void onAttach(Context context) {
super.onAttach(context);
- if (context instanceof FragmentListener) {
- mListener = (FragmentListener) context;
+ if (context instanceof FragmentListenerMain) {
+ mListener = (FragmentListenerMain) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
@@ -283,6 +285,7 @@
if(arrivalsManager!=null) arrivalsManager.cancelAllRequests();
}
+ @NonNull
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
//BUILD URI
@@ -300,7 +303,7 @@
@Override
- public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
+ public void onLoadFinished(@NonNull Loader<Cursor> loader, Cursor data) {
if (0 > MAX_DISTANCE) throw new AssertionError();
//Cursor might be null
if(data==null){
@@ -425,7 +428,7 @@
arrivalsStopAdapter.setRoutesPairListAndPosition(routesPairList,lastReceivedLocation);
}
- arrivalsStopAdapter.notifyDataSetChanged();
+ //arrivalsStopAdapter.notifyDataSetChanged();
showRecyclerHidingLoadMessage();
}
diff --git a/src/it/reyboz/bustorino/fragments/ResultListFragment.java b/src/it/reyboz/bustorino/fragments/ResultListFragment.java
--- a/src/it/reyboz/bustorino/fragments/ResultListFragment.java
+++ b/src/it/reyboz/bustorino/fragments/ResultListFragment.java
@@ -39,7 +39,7 @@
import it.reyboz.bustorino.backend.Palina;
import it.reyboz.bustorino.backend.Route;
import it.reyboz.bustorino.backend.Stop;
-import it.reyboz.bustorino.middleware.UserDB;
+import it.reyboz.bustorino.data.UserDB;
/**
* This is a generalized fragment that can be used both for
@@ -56,7 +56,7 @@
private FragmentKind adapterKind;
private boolean adapterSet = false;
- protected FragmentListener mListener;
+ protected FragmentListenerMain mListener;
protected TextView messageTextView;
protected ListView resultsListView;
@@ -138,7 +138,7 @@
* @url http://stackoverflow.com/questions/30549485/androids-list-view-parameterized-type-in-adapterview-onitemclicklistener
*/
Stop busStop = (Stop) parent.getItemAtPosition(position);
- mListener.createFragmentForStop(busStop.ID);
+ mListener.requestArrivalsForStopID(busStop.ID);
}
});
@@ -226,7 +226,7 @@
@Override
public void onPause() {
if (adapterKind.equals(FragmentKind.ARRIVALS)) {
- SwipeRefreshLayout reflay = (SwipeRefreshLayout) getActivity().findViewById(R.id.listRefreshLayout);
+ SwipeRefreshLayout reflay = getActivity().findViewById(R.id.listRefreshLayout);
reflay.setEnabled(false);
Log.d("BusTO Fragment " + this.getTag(), "RefreshLayout disabled");
}
@@ -236,8 +236,8 @@
@Override
public void onAttach(Context context) {
super.onAttach(context);
- if (context instanceof FragmentListener) {
- mListener = (FragmentListener) context;
+ if (context instanceof FragmentListenerMain) {
+ mListener = (FragmentListenerMain) context;
fabutton = (FloatingActionButton) getActivity().findViewById(R.id.floatingActionButton);
} else {
throw new RuntimeException(context.toString()
diff --git a/src/it/reyboz/bustorino/fragments/SettingsFragment.java b/src/it/reyboz/bustorino/fragments/SettingsFragment.java
--- a/src/it/reyboz/bustorino/fragments/SettingsFragment.java
+++ b/src/it/reyboz/bustorino/fragments/SettingsFragment.java
@@ -3,6 +3,7 @@
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
+import android.util.Log;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import it.reyboz.bustorino.R;
@@ -15,12 +16,21 @@
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.preferences,rootKey);
- preferences = getContext().getSharedPreferences(getString(R.string.mainSharedPreferences), Context.MODE_PRIVATE);
+ Context con = getContext();
+ if (con == null){
+ Log.w("SETTINGS FRAGMENT", "context is null");
+ preferences = null;
+ }
+ else
+ preferences = getContext().getSharedPreferences(getString(R.string.mainSharedPreferences), Context.MODE_PRIVATE);
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
Preference pref = findPreference(key);
+ //non so a cosa serva tutto questo
+
+ Log.d("BusTO Settings", "changed "+key+"\n "+sharedPreferences.getAll());
}
}
diff --git a/src/it/reyboz/bustorino/fragments/StopListFragment.java b/src/it/reyboz/bustorino/fragments/StopListFragment.java
--- a/src/it/reyboz/bustorino/fragments/StopListFragment.java
+++ b/src/it/reyboz/bustorino/fragments/StopListFragment.java
@@ -26,8 +26,8 @@
import android.util.Log;
import it.reyboz.bustorino.backend.Route;
import it.reyboz.bustorino.backend.Stop;
-import it.reyboz.bustorino.middleware.AppDataProvider;
-import it.reyboz.bustorino.middleware.NextGenDB.Contract.StopsTable;
+import it.reyboz.bustorino.data.AppDataProvider;
+import it.reyboz.bustorino.data.NextGenDB.Contract.StopsTable;
import it.reyboz.bustorino.adapters.StopAdapter;
import java.util.Arrays;
diff --git a/src/it/reyboz/bustorino/middleware/AsyncDataDownload.java b/src/it/reyboz/bustorino/middleware/AsyncDataDownload.java
--- a/src/it/reyboz/bustorino/middleware/AsyncDataDownload.java
+++ b/src/it/reyboz/bustorino/middleware/AsyncDataDownload.java
@@ -27,8 +27,9 @@
import android.util.Log;
import it.reyboz.bustorino.backend.*;
+import it.reyboz.bustorino.data.AppDataProvider;
import it.reyboz.bustorino.fragments.FragmentHelper;
-import it.reyboz.bustorino.middleware.NextGenDB.Contract.*;
+import it.reyboz.bustorino.data.NextGenDB.Contract.*;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@@ -235,12 +236,10 @@
public class BranchInserter implements Runnable{
private final List<Route> routesToInsert;
- private String stopID;
private final FragmentHelper fragmentHelper;
public BranchInserter(List<Route> routesToInsert,FragmentHelper fh,String stopID) {
this.routesToInsert = routesToInsert;
- this.stopID = stopID;
this.fragmentHelper = fh;
}
diff --git a/src/it/reyboz/bustorino/middleware/AsyncStopFavoriteAction.java b/src/it/reyboz/bustorino/middleware/AsyncStopFavoriteAction.java
--- a/src/it/reyboz/bustorino/middleware/AsyncStopFavoriteAction.java
+++ b/src/it/reyboz/bustorino/middleware/AsyncStopFavoriteAction.java
@@ -24,12 +24,13 @@
import android.widget.Toast;
import it.reyboz.bustorino.R;
import it.reyboz.bustorino.backend.Stop;
+import it.reyboz.bustorino.data.UserDB;
/**
* Handler to add or remove or toggle a Stop in your favorites
*/
public class AsyncStopFavoriteAction extends AsyncTask<Stop, Void, Boolean> {
- private Context context;
+ private final Context context;
/**
* Kind of actions available
@@ -43,15 +44,18 @@
*/
private Action action;
+ // extra stuff to do after we've done it
+ private ResultListener listener;
/**
* Constructor
*
* @param context
* @param action
*/
- public AsyncStopFavoriteAction(Context context, Action action) {
+ public AsyncStopFavoriteAction(Context context, Action action, ResultListener listener) {
this.context = context.getApplicationContext();
this.action = action;
+ this.listener = listener;
}
@Override
@@ -116,5 +120,15 @@
// wtf
Toast.makeText(this.context, R.string.cant_add_to_favorites, Toast.LENGTH_SHORT).show();
}
+ listener.doStuffWithResult(result);
}
+
+ public interface ResultListener{
+ /**
+ * Do what you need to to update the UI with the result
+ * @param result true if the action is done
+ */
+ void doStuffWithResult(Boolean result);
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 7, 12:01 (1 h, 41 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
10/6e/9c7f7b8cfec8532a6f4ffd0b310f
Default Alt Text
D50.1765105276.diff (1012 KB)

Event Timeline