Class SetupDefinitionBuilder<R extends AbstractDefinition,​T extends SetupDefinitionBuilder<R,​T,​B>,​B extends AbstractBuilder<?,​B>>

  • Type Parameters:
    R - the definition type.
    T - the type of the builder.
    B - the type of builder that is returned after this builder ends setup.
    Direct Known Subclasses:
    DtSetupDefinitionBuilder

    public class SetupDefinitionBuilder<R extends AbstractDefinition,​T extends SetupDefinitionBuilder<R,​T,​B>,​B extends AbstractBuilder<?,​B>>
    extends AbstractBuilder<R,​T>
    The definition builder that allows to setup the given definition instance.
    • Constructor Detail

      • SetupDefinitionBuilder

        protected SetupDefinitionBuilder​(Supplier<R> provider,
                                         B builder)
        Initializes a builder.
        Parameters:
        provider - the provider of object to build, cannot be null.
        builder - a builder that is returned after this builder ends setup.
    • Method Detail

      • builder

        public static <R extends AbstractDefinition,​B extends AbstractBuilder<?,​B>> SetupDefinitionBuilder<R,​?,​B> builder​(Supplier<R> definitionProvider,
                                                                                                                                                  B builder)
        Creates a new builder instance.
        Parameters:
        definitionProvider - the provider of definition to setup, cannot be null.
        builder - a builder that is returned after this builder ends setup.
        Returns:
        the builder instance.
      • layoutData

        public T layoutData​(IAefLayoutData layoutData)
        Sets the layout data object.
        Parameters:
        layoutData - the layout data.
        Returns:
        the builder instance.
      • modelFactory

        public T modelFactory​(IModelFactory modelFactory)
        Sets the model factory.
        Parameters:
        modelFactory - the model factory instance.
        Returns:
        the builder instance.
      • component

        public T component​(Class<? extends IComponent> componentClass,
                           IParameterization parameterization)
        Sets the class of component and corresponding parameterization.
        Parameters:
        componentClass - the class of component.
        Returns:
        the builder instance.
      • componentFactory

        public T componentFactory​(IComponentFactory factory)
        Sets a factory that will be used to directly obtain a component.
        Parameters:
        factory - the factory
        Returns:
        this
      • endSetup

        public B endSetup()
        Ends the setup of the definition.
        Returns:
        the original builder.