Class LateBuilder<T,B extends LateBuilder<T,B>>
java.lang.Object
de.team33.patterns.building.anthe.SelfReferring<B>
de.team33.patterns.building.elara.BuilderBase<B>
de.team33.patterns.building.elara.LateBuilder<T,B>
- Type Parameters:
T- The target type: an instance of that type is finally built. That type is expected to be mutable.B- The builder type: the intended effective type of the concrete builder implementation.
- All Implemented Interfaces:
Setup<T,B>
Serves as a base class for builder implementations
<B> and as such provides a model that separates basic
builder concepts from the actual target data model <T>.
This implementation can be used as a base if instances of a target type are to be built that is itself mutable but does not itself implement a builder pattern. The builder initially only collects the modifying operations and only applies them to a newly created target instance with build().
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLateBuilder(Supplier<? extends T> newResult, Class<B> builderClass) Initializes a new instance. -
Method Summary
Methods inherited from class de.team33.patterns.building.anthe.SelfReferring
THIS
-
Constructor Details
-
LateBuilder
Initializes a new instance.- Parameters:
newResult- ASuppliermethod to retrieve a new instance of the result type.builderClass- TheClassrepresentation of the intended effective builder type.- Throws:
IllegalArgumentException- if the given builder class does not represent this instance.
-
-
Method Details
-
setup
-
build
Returns the build result.
-