Class 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
    • Constructor Detail

      • Builder

        protected Builder​(Class<T> classToBuild)
        Constructor
        Parameters:
        classToBuild - to have access to type of T
    • 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