Skip to content

Instantly share code, notes, and snippets.

@makovkastar
Created December 5, 2017 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makovkastar/cfa4bf1bea38556279f20eef46001cf8 to your computer and use it in GitHub Desktop.
Save makovkastar/cfa4bf1bea38556279f20eef46001cf8 to your computer and use it in GitHub Desktop.
@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