Builder pattern, multiple return types

Need some help with a builder pattern, i need it to have to return types as seen in the image but i don;t know how to properly return it?
Was this page helpful?