Last active
March 21, 2019 02:39
-
-
Save jorgecasariego/c900d5416cb65e9cdc718dfce6c91056 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
class SmartPhone( | |
val manufacture: String?, | |
val model: String?, | |
val storage: String?, | |
val screenSize: String?) { | |
data class Builder( | |
var manufacture: String? = null, | |
var model: String? = null, | |
var storage: String? = null, | |
var screenSize: String? = null) { | |
fun manufacture(manufacture: String) = apply { this.manufacture = manufacture } | |
fun model(model: String) = apply { this.model = model } | |
fun storage(storage: String) = apply { this.storage = storage } | |
fun screenSize(screenSize: String) = apply { this.screenSize = screenSize } | |
fun build() = SmartPhone(manufacture, model, storage, screenSize) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment