File tree 1 file changed +34
-0
lines changed
src/main/java/com/conveyal/gtfs/model
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 9
9
import java .sql .PreparedStatement ;
10
10
import java .sql .SQLException ;
11
11
import java .util .Iterator ;
12
+ import java .util .Objects ;
12
13
13
14
/**
14
15
* Represents a GTFS StopTime. Note that once created and saved in a feed, stop times are by convention immutable
@@ -141,4 +142,37 @@ public StopTime clone () {
141
142
throw new RuntimeException (e );
142
143
}
143
144
}
145
+
146
+ @ Override
147
+ public boolean equals (Object o ) {
148
+ if (this == o ) return true ;
149
+ if (o == null || getClass () != o .getClass ()) return false ;
150
+ StopTime stopTime = (StopTime ) o ;
151
+ return arrival_time == stopTime .arrival_time &&
152
+ departure_time == stopTime .departure_time &&
153
+ stop_sequence == stopTime .stop_sequence &&
154
+ pickup_type == stopTime .pickup_type &&
155
+ drop_off_type == stopTime .drop_off_type &&
156
+ Double .compare (stopTime .shape_dist_traveled , shape_dist_traveled ) == 0 &&
157
+ timepoint == stopTime .timepoint &&
158
+ Objects .equals (trip_id , stopTime .trip_id ) &&
159
+ Objects .equals (stop_id , stopTime .stop_id ) &&
160
+ Objects .equals (stop_headsign , stopTime .stop_headsign );
161
+ }
162
+
163
+ @ Override
164
+ public int hashCode () {
165
+ return Objects .hash (
166
+ trip_id ,
167
+ arrival_time ,
168
+ departure_time ,
169
+ stop_id ,
170
+ stop_sequence ,
171
+ stop_headsign ,
172
+ pickup_type ,
173
+ drop_off_type ,
174
+ shape_dist_traveled ,
175
+ timepoint
176
+ );
177
+ }
144
178
}
You can’t perform that action at this time.
0 commit comments