Class BaseMultiItemSelector
java.lang.Object
org.springframework.shell.component.flow.BaseInput<MultiItemSelectorSpec>
org.springframework.shell.component.flow.BaseMultiItemSelector
- All Implemented Interfaces:
org.springframework.core.Ordered,BaseInputSpec<MultiItemSelectorSpec>,MultiItemSelectorSpec
- Direct Known Subclasses:
DefaultMultiInputSpec
public abstract class BaseMultiItemSelector
extends BaseInput<MultiItemSelectorSpec>
implements MultiItemSelectorSpec
Base impl for
MultiItemSelectorSpec.-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand()Build and return parent builder.getName()getNext()Function<MultiItemSelector.MultiItemSelectorContext<String,SelectorItem<String>>, List<org.jline.utils.AttributedString>> getThis()Usual this trick to get typed child.booleanmax(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 aComparatorfor sorting items.storeResult(boolean store) Automatically stores result from aMultiItemSelector.MultiItemSelectorContextintoComponentContextwith key given to builder.Sets a default renderer template location.Methods inherited from class org.springframework.shell.component.flow.BaseInput
getBuilder, getId, getOrder, order, setOrderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.shell.component.flow.BaseInputSpec
order
-
Constructor Details
-
BaseMultiItemSelector
-
-
Method Details
-
name
Description copied from interface:MultiItemSelectorSpecSets a name.- Specified by:
namein interfaceMultiItemSelectorSpec- Parameters:
name- the name- Returns:
- a builder
-
resultValues
Description copied from interface:MultiItemSelectorSpecSets a result values.- Specified by:
resultValuesin interfaceMultiItemSelectorSpec- Parameters:
resultValues- the result values- Returns:
- a builder
-
resultMode
Description copied from interface:MultiItemSelectorSpecSets a result mode.- Specified by:
resultModein interfaceMultiItemSelectorSpec- Parameters:
resultMode- the result mode- Returns:
- a builder
-
selectItems
Description copied from interface:MultiItemSelectorSpecAdds a list of select items.- Specified by:
selectItemsin interfaceMultiItemSelectorSpec- Parameters:
selectItems- the select items- Returns:
- a builder
-
sort
Description copied from interface:MultiItemSelectorSpecSets aComparatorfor sorting items.- Specified by:
sortin interfaceMultiItemSelectorSpec- Parameters:
comparator- the item comparator- Returns:
- a builder
-
renderer
public MultiItemSelectorSpec renderer(Function<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>, List<org.jline.utils.AttributedString>> renderer) Description copied from interface:MultiItemSelectorSpecSets a renderer function.- Specified by:
rendererin interfaceMultiItemSelectorSpec- Parameters:
renderer- the renderer- Returns:
- a builder
-
template
Description copied from interface:MultiItemSelectorSpecSets a default renderer template location.- Specified by:
templatein interfaceMultiItemSelectorSpec- Parameters:
location- the template location- Returns:
- a builder
-
max
Description copied from interface:MultiItemSelectorSpecSets a maximum number of items in a selector list;- Specified by:
maxin interfaceMultiItemSelectorSpec- Parameters:
max- the maximum number of items- Returns:
- a builder
-
preHandler
public MultiItemSelectorSpec preHandler(Consumer<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>> handler) Description copied from interface:MultiItemSelectorSpecAdds a pre-run context handler.- Specified by:
preHandlerin interfaceMultiItemSelectorSpec- Parameters:
handler- the context handler- Returns:
- a builder
-
postHandler
public MultiItemSelectorSpec postHandler(Consumer<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>> handler) Description copied from interface:MultiItemSelectorSpecAdds a post-run context handler.- Specified by:
postHandlerin interfaceMultiItemSelectorSpec- Parameters:
handler- the context handler- Returns:
- a builder
-
storeResult
Description copied from interface:MultiItemSelectorSpecAutomatically stores result from aMultiItemSelector.MultiItemSelectorContextintoComponentContextwith key given to builder. Defaults totrue.- Specified by:
storeResultin interfaceMultiItemSelectorSpec- Parameters:
store- the flag if storing result- Returns:
- a builder
-
next
public MultiItemSelectorSpec next(Function<MultiItemSelector.MultiItemSelectorContext<String, SelectorItem<String>>, String> next) Description copied from interface:MultiItemSelectorSpecDefine a function which may return id of a next component to go. Returning anullor non existent id indicates that flow should stop.- Specified by:
nextin interfaceMultiItemSelectorSpec- Parameters:
next- next component function- Returns:
- a builder
-
and
Description copied from interface:MultiItemSelectorSpecBuild and return parent builder.- Specified by:
andin interfaceMultiItemSelectorSpec- Returns:
- the parent builder
-
getThis
Description copied from interface:BaseInputSpecUsual this trick to get typed child.- Specified by:
getThisin interfaceBaseInputSpec<MultiItemSelectorSpec>- Returns:
- a builder
-
getName
-
getResultValues
-
getResultMode
-
getSelectItems
-
getComparator
-
getRenderer
public Function<MultiItemSelector.MultiItemSelectorContext<String,SelectorItem<String>>, getRenderer()List<org.jline.utils.AttributedString>> -
getTemplateLocation
-
getMaxItems
-
getPreHandlers
public List<Consumer<MultiItemSelector.MultiItemSelectorContext<String,SelectorItem<String>>>> getPreHandlers() -
getPostHandlers
public List<Consumer<MultiItemSelector.MultiItemSelectorContext<String,SelectorItem<String>>>> getPostHandlers() -
isStoreResult
public boolean isStoreResult() -
getNext
public Function<MultiItemSelector.MultiItemSelectorContext<String,SelectorItem<String>>, getNext()String>
-