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 Hotel { | |
val name: String | |
val city: String | |
val stars: Int | |
private var jimIncluded = false | |
constructor(name: String, city: String, stars: Int) { | |
this.name = name | |
this.city = city | |
this.stars = stars |
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
package patterns | |
interface CarService { | |
fun doService() | |
} | |
interface CarServiceDecorator : CarService | |
class BasicCarService : CarService { | |
override fun doService() = println("Doing basic checkup ... DONE") |
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
package patterns.head_first | |
class CoffeeMachine { | |
var state: CoffeeMachineState | |
val MAX_BEANS_QUANTITY = 100 | |
val MAX_WATER_QUANTITY = 100 | |
var beansQuantity = 0 | |
var waterQuantity = 0 | |
val offState = Off(this) | |
val noIngredients = NoIngredients(this) |
OlderNewer