Interface MultiItemSelectorSpec
- All Superinterfaces:
BaseInputSpec<MultiItemSelectorSpec>
- All Known Implementing Classes:
BaseMultiItemSelector
,DefaultMultiInputSpec
Interface for multi input spec builder.
-
Method Summary
Modifier and TypeMethodDescriptionand()
Build and return parent builder.max
(int max) Sets a maximum number of items in a selector list;Sets a name.Define a function which may return id of a next component to go.postHandler
(Consumer<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>> handler) Adds a post-run context handler.preHandler
(Consumer<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>> handler) Adds a pre-run context handler.renderer
(Function<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>, List<org.jline.utils.AttributedString>> renderer) Sets a renderer function.resultMode
(ResultMode resultMode) Sets a result mode.resultValues
(List<String> resultValues) Sets a result values.selectItems
(List<SelectItem> selectItems) Adds a list of select items.sort
(Comparator<SelectorItem<String>> comparator) Sets aComparator
for sorting items.storeResult
(boolean store) Automatically stores result from aMultiItemSelector.MultiItemSelectorContext
intoComponentContext
with key given to builder.Sets a default renderer template location.Methods inherited from interface org.springframework.shell.component.flow.BaseInputSpec
getThis, order
-
Method Details
-
name
Sets a name.- Parameters:
name
- the name- Returns:
- a builder
-
resultValues
Sets a result values.- Parameters:
resultValues
- the result values- Returns:
- a builder
-
resultMode
Sets a result mode.- Parameters:
resultMode
- the result mode- Returns:
- a builder
-
selectItems
Adds a list of select items.- Parameters:
selectItems
- the select items- Returns:
- a builder
-
sort
Sets aComparator
for sorting items.- Parameters:
comparator
- the item comparator- Returns:
- a builder
-
renderer
MultiItemSelectorSpec renderer(Function<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>, List<org.jline.utils.AttributedString>> renderer) Sets a renderer function.- Parameters:
renderer
- the renderer- Returns:
- a builder
-
template
Sets a default renderer template location.- Parameters:
location
- the template location- Returns:
- a builder
-
max
Sets a maximum number of items in a selector list;- Parameters:
max
- the maximum number of items- Returns:
- a builder
-
preHandler
MultiItemSelectorSpec preHandler(Consumer<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>> handler) Adds a pre-run context handler.- Parameters:
handler
- the context handler- Returns:
- a builder
-
postHandler
MultiItemSelectorSpec postHandler(Consumer<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>> handler) Adds a post-run context handler.- Parameters:
handler
- the context handler- Returns:
- a builder
-
storeResult
Automatically stores result from aMultiItemSelector.MultiItemSelectorContext
intoComponentContext
with key given to builder. Defaults totrue
.- Parameters:
store
- the flag if storing result- Returns:
- a builder
-
next
MultiItemSelectorSpec next(Function<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>, String> next) Define a function which may return id of a next component to go. Returning anull
or non existent id indicates that flow should stop.- Parameters:
next
- next component function- Returns:
- a builder
-
and
ComponentFlow.Builder and()Build and return parent builder.- Returns:
- the parent builder
-