Skip to content

Commit 2ec0a38

Browse files
committed
Add helper property isUsedAsTimingPoint to TripStopRecord.
1 parent 8202ea4 commit 2ec0a38

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/kotlin/fi/hsl/jore4/hastus/data/hastus/TripStopRecord.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ data class TripStopRecord(
3434
val note: String
3535
) : HastusData() {
3636

37+
val isUsedAsTimingPoint: Boolean
38+
get() = stopType == "T" || stopType == "R"
39+
3740
// The value of timing place is taken if the stop point is used as a timing point in journey
3841
// pattern.
3942
val effectiveTimingPlace: String?
40-
get() = timingPlace?.takeIf { stopType == "T" || stopType == "R" }
43+
get() = timingPlace?.takeIf { isUsedAsTimingPoint }
4144

4245
constructor(elements: List<String>) : this(
4346
tripInternalNumber = elements[1],

0 commit comments

Comments
 (0)