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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand()Build and return parent builder.defaultValue(Boolean defaultValue) Sets a default value.booleangetName()getNext()Function<ConfirmationInput.ConfirmationInputContext,List<org.jline.utils.AttributedString>> getThis()Usual this trick to get typed child.booleanSets 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.ConfirmationInputContextintoComponentContextwith 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
-
BaseConfirmationInput
-
-
Method Details
-
name
Description copied from interface:ConfirmationInputSpecSets a name.- Specified by:
namein interfaceConfirmationInputSpec- Parameters:
name- the name- Returns:
- a builder
-
resultValue
Description copied from interface:ConfirmationInputSpecSets a result value.- Specified by:
resultValuein interfaceConfirmationInputSpec- Parameters:
resultValue- the result value- Returns:
- a builder
-
resultMode
Description copied from interface:ConfirmationInputSpecSets a result mode.- Specified by:
resultModein interfaceConfirmationInputSpec- Parameters:
resultMode- the result mode- Returns:
- a builder
-
defaultValue
Description copied from interface:ConfirmationInputSpecSets a default value.- Specified by:
defaultValuein 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:ConfirmationInputSpecSets a renderer function.- Specified by:
rendererin interfaceConfirmationInputSpec- Parameters:
renderer- the renderer- Returns:
- a builder
-
template
Description copied from interface:ConfirmationInputSpecSets a default renderer template location.- Specified by:
templatein interfaceConfirmationInputSpec- Parameters:
location- the template location- Returns:
- a builder
-
preHandler
public ConfirmationInputSpec preHandler(Consumer<ConfirmationInput.ConfirmationInputContext> handler) Description copied from interface:ConfirmationInputSpecAdds a pre-run context handler.- Specified by:
preHandlerin interfaceConfirmationInputSpec- Parameters:
handler- the context handler- Returns:
- a builder
-
postHandler
public ConfirmationInputSpec postHandler(Consumer<ConfirmationInput.ConfirmationInputContext> handler) Description copied from interface:ConfirmationInputSpecAdds a post-run context handler.- Specified by:
postHandlerin interfaceConfirmationInputSpec- Parameters:
handler- the context handler- Returns:
- a builder
-
storeResult
Description copied from interface:ConfirmationInputSpecAutomatically stores result from aConfirmationInput.ConfirmationInputContextintoComponentContextwith key given to builder. Defaults totrue.- Specified by:
storeResultin interfaceConfirmationInputSpec- Parameters:
store- the flag if storing result- Returns:
- a builder
-
next
Description copied from interface:ConfirmationInputSpecDefine 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 interfaceConfirmationInputSpec- Parameters:
next- next component function- Returns:
- a builder
-
and
Description copied from interface:ConfirmationInputSpecBuild and return parent builder.- Specified by:
andin interfaceConfirmationInputSpec- Returns:
- the parent builder
-
getThis
Description copied from interface:BaseInputSpecUsual this trick to get typed child.- Specified by:
getThisin 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
-