Last active
June 16, 2017 15:27
-
-
Save rostyslav-y/706475faa43eabe1b0928108404e3665 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
data class Vehicle(val id: Long, | |
val vin: Vin, | |
val ownerId: Long, | |
val plateNumber: String, | |
val manufacturer: String, | |
val model: String, | |
val bodyType: BodyType, | |
val color: Long) : VehicleModel { | |
override fun _id(): Long = id | |
override fun vin(): Vin = vin | |
override fun owner_id(): Long = ownerId | |
override fun plate_number(): String = plateNumber | |
override fun manufacturer(): String = manufacturer | |
override fun model(): String = model | |
override fun body_type(): BodyType = bodyType | |
override fun color(): Long? = color | |
companion object { | |
private val CREATOR = VehicleModel.Creator { _id, vin, owner_id, plate_number, manufacturer, model, body_type, color -> | |
Vehicle(_id, vin, owner_id, plate_number, manufacturer, model, body_type, color ?: 0L) | |
} | |
val FACTORY = VehicleModel.Factory(CREATOR, VinAdapter.INSTANCE, BodyTypeAdapter.INSTANCE) | |
val MAPPER = VehicleModel.Mapper(FACTORY) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment