Class BuilderBase<B extends BuilderBase<B>>
java.lang.Object
de.team33.patterns.building.elara.BuilderBase<B>
- Type Parameters:
B- The builder type: the intended effective type of the concrete builder implementation.
- Direct Known Subclasses:
LateBuilder,ProtoBuilder
Base class of a generic class hierarchy that has a type parameter intended to represent the effective type of
concrete implementation.
The main purpose is the realization of a generic builder pattern, whereby there should be methods that should result in this - i.e. the builder instance itself - in order to chain further method calls.
For this purpose, it should be ensured in the constructor that this actually corresponds to the designated type.
TODO: should be independent : "class SelfReferring"
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilderBase(Class<B> builderClass) Initializes a new instance and checks the intended builder type for consistency. -
Method Summary
-
Constructor Details
-
BuilderBase
Initializes a new instance and checks the intended builder type for consistency.- Parameters:
builderClass- TheClassrepresentation of the intended effective builder type.- Throws:
IllegalArgumentException- if the given builder class does not represent this instance.
-
-
Method Details
-
THIS
Returns this as an instance of the effective builder type<B>.
-