-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b3c038
commit 59a10a5
Showing
6 changed files
with
37 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
...p-planner/state/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/state/timetable/Trip.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
package xyz.ksharma.krail.trip_planner.ui.state.timetable | ||
|
||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.json.Json | ||
|
||
@Serializable | ||
data class Trip( | ||
val fromStopId: String, | ||
val fromStopName: String, | ||
val toStopId: String, | ||
val toStopName: String, | ||
) | ||
) { | ||
fun toJsonString() = Json.encodeToString(serializer(), this) | ||
|
||
companion object { | ||
fun fromJsonString(json: String) = | ||
kotlin.runCatching { Json.decodeFromString(serializer(), json) }.getOrNull() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
sandook/api/src/main/kotlin/xyz/ksharma/krail/sandook/Sandook.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
package xyz.ksharma.krail.sandook | ||
|
||
import kotlin.reflect.KClass | ||
|
||
interface Sandook { | ||
|
||
fun clear() | ||
|