Class AskAsAsker
- All Implemented Interfaces:
Asker
Provides a bridge between having a nice CLI UX (via the CompositeAsker) and accepting any aggregate expression for the wizard questions (which simplifies the config and means you can still do some advanced expression-y things with a plain old wizard model).
-
Field Summary
Fields inherited from class nz.org.riskscape.wizard.ask.BaseAsker
enumTranslator, translationContext
-
Constructor Summary
ConstructorDescriptionAskAsAsker
(nz.org.riskscape.engine.i18n.TranslationContext translationContext) -
Method Summary
Modifier and TypeMethodDescriptionnz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.wizard.Answer.Response>
ask
(AskRequest input) Get a bound value from the user - note that the response's original input is returned fromBaseAsker.askUnbound(AskRequest)
.boolean
canAsk
(nz.org.riskscape.wizard.bld.IncrementalBuildState buildState, nz.org.riskscape.wizard.Question question) Methods inherited from class nz.org.riskscape.wizard.ask.BaseAsker
askUnbound, getChoices, getLocale, getMessage, getMessageSource, getOptionalMessage, pickChoice, toChoice
-
Constructor Details
-
AskAsAsker
public AskAsAsker(nz.org.riskscape.engine.i18n.TranslationContext translationContext)
-
-
Method Details
-
canAsk
public boolean canAsk(nz.org.riskscape.wizard.bld.IncrementalBuildState buildState, nz.org.riskscape.wizard.Question question) Description copied from interface:Asker
Determine whether this
Asker
is relevant for the givenQuestion
andIncrementalBuildState
- Returns:
- true if this
Asker
can and should drive the cli to answer the givenQuestion
.
-
ask
public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.wizard.Answer.Response> ask(AskRequest input) Description copied from class:BaseAsker
Get a bound value from the user - note that the response's original input is returned from
BaseAsker.askUnbound(AskRequest)
. This is partly here because the original API exposed this method on the interface, and keeping this method here keeps the refactoring/change noise down to a minimum while allowing the interface to change in the way we want to preserve the right amount of encapsulation
-