Created
December 5, 2017 12:36
-
-
Save makovkastar/cfa4bf1bea38556279f20eef46001cf8 to your computer and use it in GitHub Desktop.
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
@Parcelize | |
@SuppressLint("ParcelCreator") | |
data class HomeChargerLocation(val connectionId: String, | |
val intervalEnabled: Boolean, | |
val clusterReference: String, | |
val address: Address, | |
val car: Car, | |
val status: Status) : Parcelable { | |
@Parcelize | |
data class Address(val addressLine: String, | |
val postalCode: String, | |
val latitude: Double, | |
val longitude: Double) : Parcelable | |
@Parcelize | |
data class Car(val latitude: Double, | |
val longitude: Double) : Parcelable | |
enum class Status { | |
CONNECTED, | |
NOT_CONNECTED, | |
TOO_MUCH_DISTANCE, | |
NO_COMPATIBLE_ADDRESS | |
} | |
fun isTooMuchDistance() = status == HomeChargerLocation.Status.TOO_MUCH_DISTANCE | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment