Class Prompt

    • Constructor Detail

      • Prompt

        public Prompt()
        Creates a new empty prompt.
      • Prompt

        public Prompt​(Prompt.Type... type)
        Creates a new prompt with the specified types.
        Parameters:
        type - The prompt types.
      • Prompt

        public Prompt​(String... values)
        Creates a new prompt with the specified type values.
        Parameters:
        values - The prompt type values.
        Throws:
        IllegalArgumentException - If the type value is invalid.
    • Method Detail

      • isValid

        public boolean isValid()
        Checks if the prompt is valid. This is done by examining the prompt for a conflicting Prompt.Type.NONE value.
        Returns:
        true if this prompt if valid, else false.
      • toStringList

        public List<StringtoStringList()
        Returns the string list representation of this prompt.
        Returns:
        The string list representation.
      • parse

        public static Prompt parse​(Collection<String> collection)
                            throws ParseException
        Parses a prompt from the specified string list.
        Parameters:
        collection - The string list to parse, with one or more non-conflicting prompt types. May be null.
        Returns:
        The prompt, null if the parsed string list was null or empty.
        Throws:
        ParseException - If the string list couldn't be parsed to a valid prompt.
      • parse

        public static Prompt parse​(String s)
                            throws ParseException
        Parses a prompt from the specified string.
        Parameters:
        s - The string to parse, with one or more non-conflicting space delimited prompt types. May be null.
        Returns:
        The prompt, null if the parsed string was null or empty.
        Throws:
        ParseException - If the string couldn't be parsed to a valid prompt.