Interface RequestOperation


public interface RequestOperation
Operation providing means to select from a set of answers.
Since:
4.2.427
  • Field Details

  • Method Details

    • setTitle

      void setTitle(String title)
      Set the title of the selection.
      Parameters:
      title - The selection operation's title.
      Since:
      4.2.427
    • setKind

      void setKind(@NotNull @NotNull RequestOperation.Kind kind)
      Set the kind of request to be answered. Defaults to RequestOperation.Kind.INFO.
      Parameters:
      kind - The request kind.
      Since:
      4.2.427
    • addAnswer

      RequestOperation.Answer addAnswer(String label)
      Add an answer with the given label. Answers will be displayed in the order added.
      Parameters:
      label - The label.
      Since:
      4.2.427
    • addYes

      Adds an answer with a language dependent label for "yes".
      Returns:
      The yes-answer
      Since:
      4.2.427
    • addNo

      Adds an answer with a language dependent label for "no".
      Returns:
      The no-answer
      Since:
      4.2.427
    • addOk

      Adds an answer with a language dependent label for "ok".
      Returns:
      The ok-answer
      Since:
      4.2.427
    • addCancel

      Adds an answer with a language dependent label for "cancel".
      Returns:
      null
      Since:
      4.2.427
    • setInitialAnswer

      void setInitialAnswer(RequestOperation.Answer answer)
      Defines the answer to be initially selected. Defaults to the last added answer.
      Parameters:
      answer - The initial answer.
      Since:
      4.2.427
    • perform

      @Nullable @Nullable RequestOperation.Answer perform(@NotNull @NotNull String question)
      Asks the given question, returning the selected answer.
      Parameters:
      question - The question to be asked.
      Returns:
      The selected answer or null, if the request was closed with no answer.
      Since:
      4.2.427