Scala, Design Patterns, Programming, Builder Pattern, Coding.
outside the signature. protected def this() = this("", "", 0.0) The setTitle method returns a BookBuilder with a HasTitle for its generic type. The setAuthor checks that the BookBuilder generic type it’s the HasTitle type and returns a BookBuilder with HasAuthor type. Lastly, the setPrice method