Class ChoiceBuilder.Ready

Object
akka.javasdk.decision.ChoiceBuilder.Ready
Enclosing class:
ChoiceBuilder

public static final class ChoiceBuilder.Ready extends Object
A choice question with at least two options. Add more options or build the question.
  • Method Details

    • option

      public ChoiceBuilder.Ready option(String key, String description)
      Add another option.
      Parameters:
      key - the key returned in Answer.Choice.selected() when the model picks this option
      description - what the option covers
    • build

      public Question.Choice build(String key)
      Build the question with the given key. The key identifies the question and its answer, so it must be the same everywhere the question is built, also across restarts and services.
      Throws:
      IllegalArgumentException - when two options have the same key