Closed drekbour closed 7 years ago
This looks perfectly good for me. I would do it the same.
What exactly do you want to change about this?
Users don't want to have to have to write facades for this, however small. The value of PB over, say, and IDE-generated builder is the depth of features that can be added "just work".
withBuilderInterface = Supplier.class
either as a special case (this is a language feature) or by generalising the public T build()
check to public T <anything>()
Alright.
I will add support for 'builder' interfaces that hava a get()
method as an alternative to build()
.
PBs should be capable of implementing
java.util.function.Supplier<T>
. Currently I need to write:then give that as directive
withBuilderInterface = SupplierBuilder.class