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 TypeMethodDescriptionwithBuilder(ComponentBuilder<? extends C> builder) Creates aComponentDefinitionthat creates an instance on-demand using the givenbuildermethod.withInstance(C instance) Creates aComponentDefinitionwith the given pre-instantiatedinstanceof a component.
-
Method Details
-
withInstance
Creates aComponentDefinitionwith the given pre-instantiatedinstanceof 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
ComponentDefinitionfor further configuration.
-
withBuilder
Creates aComponentDefinitionthat creates an instance on-demand using the givenbuildermethod.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
ComponentDefinitionfor further configuration.
-