Interface ComponentDefinition.IncompleteComponentDefinition<C>

Type Parameters:
C - The declared type of the component.
Enclosing interface:
ComponentDefinition<C>

public static interface ComponentDefinition.IncompleteComponentDefinition<C>
Represents an intermediate step in the creation of a ComponentDefinition.

This step requires the call of either withInstance(...) or withBuilder(...) to create a usable ComponentDefinition.

  • Method Summary

    Modifier and Type
    Method
    Description
    withBuilder(ComponentBuilder<? extends C> builder)
    Creates a ComponentDefinition that creates an instance on-demand using the given builder method.
    withInstance(C instance)
    Creates a ComponentDefinition with the given pre-instantiated instance of a component.
  • Method Details

    • withInstance

      ComponentDefinition<C> withInstance(@Nonnull C instance)
      Creates a ComponentDefinition with the given pre-instantiated instance of a component.

      If you require lazy instantiation of components, consider using withBuilder(ComponentBuilder) instead.

      Parameters:
      instance - The instance to declare as the implementation of this component.
      Returns:
      A ComponentDefinition for further configuration.
    • withBuilder

      ComponentDefinition<C> withBuilder(@Nonnull ComponentBuilder<? extends C> builder)
      Creates a ComponentDefinition that creates an instance on-demand using the given builder method.

      If you have already instantiated a component, consider using withInstance(Object) instead.

      Parameters:
      builder - The builder used to create an instance, when required.
      Returns:
      A ComponentDefinition for further configuration.