Interface NumberPrompt

  • All Superinterfaces:
    InputPrompt, Prompt
    All Known Implementing Classes:
    DefaultNumberPrompt

    public interface NumberPrompt
    extends InputPrompt
    Interface for number prompts. A number prompt is like an input prompt but validates that the input is a valid number.
    • Method Detail

      • getMin

        default java.lang.Double getMin()
        Get the minimum allowed value.
        Returns:
        the minimum value, or null for no minimum
      • getMax

        default java.lang.Double getMax()
        Get the maximum allowed value.
        Returns:
        the maximum value, or null for no maximum
      • allowDecimals

        default boolean allowDecimals()
        Whether to allow decimal numbers or only integers.
        Returns:
        true to allow decimals, false for integers only
      • getDefaultNumber

        default java.lang.Double getDefaultNumber()
        Get the default value as a number.
        Returns:
        the default number value, or null for no default
      • getInvalidNumberMessage

        default java.lang.String getInvalidNumberMessage()
        Get the error message to show for invalid numbers.
        Returns:
        the error message
      • getOutOfRangeMessage

        default java.lang.String getOutOfRangeMessage()
        Get the error message to show for out-of-range numbers.
        Returns:
        the error message