Class BaseConfirmationInput
java.lang.Object
org.springframework.shell.component.flow.BaseInput<ConfirmationInputSpec>
org.springframework.shell.component.flow.BaseConfirmationInput
- All Implemented Interfaces:
org.springframework.core.Ordered
,BaseInputSpec<ConfirmationInputSpec>
,ConfirmationInputSpec
- Direct Known Subclasses:
DefaultConfirmationInputSpec
public abstract class BaseConfirmationInput
extends BaseInput<ConfirmationInputSpec>
implements ConfirmationInputSpec
Base impl for
ConfirmationInputSpec
.-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionand()
Build and return parent builder.defaultValue
(Boolean defaultValue) Sets a default value.boolean
getName()
getNext()
Function<ConfirmationInput.ConfirmationInputContext,
List<org.jline.utils.AttributedString>> getThis()
Usual this trick to get typed child.boolean
Sets a name.Define a function which may return id of a next component to go.Adds a post-run context handler.Adds a pre-run context handler.renderer
(Function<ConfirmationInput.ConfirmationInputContext, List<org.jline.utils.AttributedString>> renderer) Sets a renderer function.resultMode
(ResultMode resultMode) Sets a result mode.resultValue
(Boolean resultValue) Sets a result value.storeResult
(boolean store) Automatically stores result from aConfirmationInput.ConfirmationInputContext
intoComponentContext
with key given to builder.Sets a default renderer template location.Methods inherited from class org.springframework.shell.component.flow.BaseInput
getBuilder, getId, getOrder, order, setOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.shell.component.flow.BaseInputSpec
order
-
Constructor Details
-
BaseConfirmationInput
-
-
Method Details
-
name
Description copied from interface:ConfirmationInputSpec
Sets a name.- Specified by:
name
in interfaceConfirmationInputSpec
- Parameters:
name
- the name- Returns:
- a builder
-
resultValue
Description copied from interface:ConfirmationInputSpec
Sets a result value.- Specified by:
resultValue
in interfaceConfirmationInputSpec
- Parameters:
resultValue
- the result value- Returns:
- a builder
-
resultMode
Description copied from interface:ConfirmationInputSpec
Sets a result mode.- Specified by:
resultMode
in interfaceConfirmationInputSpec
- Parameters:
resultMode
- the result mode- Returns:
- a builder
-
defaultValue
Description copied from interface:ConfirmationInputSpec
Sets a default value.- Specified by:
defaultValue
in interfaceConfirmationInputSpec
- Parameters:
defaultValue
- the defult value- Returns:
- a builder
-
renderer
public ConfirmationInputSpec renderer(Function<ConfirmationInput.ConfirmationInputContext, List<org.jline.utils.AttributedString>> renderer) Description copied from interface:ConfirmationInputSpec
Sets a renderer function.- Specified by:
renderer
in interfaceConfirmationInputSpec
- Parameters:
renderer
- the renderer- Returns:
- a builder
-
template
Description copied from interface:ConfirmationInputSpec
Sets a default renderer template location.- Specified by:
template
in interfaceConfirmationInputSpec
- Parameters:
location
- the template location- Returns:
- a builder
-
preHandler
public ConfirmationInputSpec preHandler(Consumer<ConfirmationInput.ConfirmationInputContext> handler) Description copied from interface:ConfirmationInputSpec
Adds a pre-run context handler.- Specified by:
preHandler
in interfaceConfirmationInputSpec
- Parameters:
handler
- the context handler- Returns:
- a builder
-
postHandler
public ConfirmationInputSpec postHandler(Consumer<ConfirmationInput.ConfirmationInputContext> handler) Description copied from interface:ConfirmationInputSpec
Adds a post-run context handler.- Specified by:
postHandler
in interfaceConfirmationInputSpec
- Parameters:
handler
- the context handler- Returns:
- a builder
-
storeResult
Description copied from interface:ConfirmationInputSpec
Automatically stores result from aConfirmationInput.ConfirmationInputContext
intoComponentContext
with key given to builder. Defaults totrue
.- Specified by:
storeResult
in interfaceConfirmationInputSpec
- Parameters:
store
- the flag if storing result- Returns:
- a builder
-
next
Description copied from interface:ConfirmationInputSpec
Define a function which may return id of a next component to go. Returning anull
or non existent id indicates that flow should stop.- Specified by:
next
in interfaceConfirmationInputSpec
- Parameters:
next
- next component function- Returns:
- a builder
-
and
Description copied from interface:ConfirmationInputSpec
Build and return parent builder.- Specified by:
and
in interfaceConfirmationInputSpec
- Returns:
- the parent builder
-
getThis
Description copied from interface:BaseInputSpec
Usual this trick to get typed child.- Specified by:
getThis
in interfaceBaseInputSpec<ConfirmationInputSpec>
- Returns:
- a builder
-
getName
-
getDefaultValue
public boolean getDefaultValue() -
getResultValue
-
getResultMode
-
getRenderer
public Function<ConfirmationInput.ConfirmationInputContext,List<org.jline.utils.AttributedString>> getRenderer() -
getTemplateLocation
-
getPreHandlers
-
getPostHandlers
-
isStoreResult
public boolean isStoreResult() -
getNext
-