Module gomint.api

Class EnumValidator

    • Constructor Detail

      • EnumValidator

        public EnumValidator​(List<String> enumValues)
    • Method Detail

      • consume

        public String consume​(Iterator<String> data)
        Consume all parts this validator needs as input from the command
        Specified by:
        consume in class ParamValidator
        data - left from the command which can be consumed
        the concatenated data consumed
      • validate

        public Object validate​(String input,
                               CommandSender commandSender)
        Validates given input
        Specified by:
        validate in class ParamValidator
        input - from the command
        commandSender - which submitted the command
        non null object of validation on success (string for example) or null when validation failed
      • hasValues

        public boolean hasValues()
        Does this validator have values which should be sent with the command. This is mostly used by enum params which define a set of values for selection.
        Specified by:
        hasValues in class ParamValidator
        true when there is data to be sent with this parameter, false when not
      • getHelpText

        public String getHelpText()
        Get a proper help text for the console output
        getHelpText in class ParamValidator
        help text for the console