The usual result builder examples use only one component type. How can a builder with multiple component types work. Both when component types can be in any order, and when there are (partial) order restrictions. (Example: result types A, B, C, and D can be in any order except all B must come before the first C.)
I think this post of mine should answer your question. The super short summary is: you can use buildPartialBlock, and include marker types in the partial results to turn the builder into a state machine where possible state transitions are defined by buildPartialBlock overloads.
For my example, we’d have a PreC and PostCstate types. If you build from either state with either A or D, you always get the same C-state type. If the input is a C, always return a PostC state type. Pairing B with PreC returns another PreC, but a B overload with PostC is intentionally left out.