Package org.goplanit.utils.builder
Class Builder<T>
- java.lang.Object
-
- org.goplanit.utils.builder.Builder<T>
-
- Type Parameters:
T
- class to build
- Direct Known Subclasses:
PlanitComponentBuilder
public abstract class Builder<T> extends Object
Builder class to build something of type T- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract T
build()
Build an instance of class Tprotected abstract Configurator<T>
createConfigurator()
Allow derived classes to provide their own configurator for this builder, by default we create a base class configuratorprotected Class<T>
getClassToBuild()
collect the class to buildConfigurator<T>
getConfigurator()
the configurator for this builder.
-
-
-
Method Detail
-
createConfigurator
protected abstract Configurator<T> createConfigurator() throws PlanItException
Allow derived classes to provide their own configurator for this builder, by default we create a base class configurator- Returns:
- appropriate configurator
- Throws:
PlanItException
- thrown if error
-
getClassToBuild
protected Class<T> getClassToBuild()
collect the class to build- Returns:
- the class to build
-
getConfigurator
public Configurator<T> getConfigurator()
the configurator for this builder. It allows one to hide the builder aspect and expose (parts of) the user available configuration options via this object- Returns:
- the configurator, null if no configurator is available nor could be created
-
build
public abstract T build() throws PlanItException
Build an instance of class T- Returns:
- instance of T
- Throws:
PlanItException
- thrown when error
-
-