builder-pattern-breakfastbuilder-reduced-sample.kt

Home   »   builder-pattern-breakfastbuilder-reduced-sample.kt

class BreakfastBuilder {
    var eggs = false
    var bacon = false
    var breadSlices = 0
    var drink = Drink.NATURAL_JUICE

    fun build(): Meal.Breakfast = Meal.Breakfast(eggs, bacon, breadSlices, drink)
}

Leave a Reply

Your email address will not be published. Required fields are marked *