We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45d07c3 commit efecaecCopy full SHA for efecaec
src/main/java/travelator/itinerary/Route.kt
@@ -5,7 +5,7 @@ import java.time.Duration
5
import java.util.*
6
7
class Route(
8
- private val journeys: List<Journey>
+ val journeys: List<Journey>
9
) {
10
fun size(): Int = journeys.size
11
@@ -20,11 +20,12 @@ class Route(
20
get(size() - 1).arrivalTime
21
)
22
23
- fun withJourneyAt(index: Int, replacedBy: Journey): Route {
24
- val newJourneys = ArrayList(journeys)
25
- newJourneys[index] = replacedBy
26
- return Route(newJourneys)
27
- }
+}
+
+fun Route.withJourneyAt(index: Int, replacedBy: Journey): Route {
+ val newJourneys = ArrayList(journeys)
+ newJourneys[index] = replacedBy
28
+ return Route(newJourneys)
29
}
30
31
val Route.departsFrom: Location
0 commit comments