Module gomint.api

Class CommandValidator


  • public class CommandValidator
    extends EnumValidator
    Version:
    1.0
    Author:
    geNAZt
    • Constructor Detail

      • CommandValidator

        public CommandValidator()
    • Method Detail

      • validate

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

        public String consume​(Iterator<String> data)
        Consume all parts this validator needs as input from the command
        Overrides:
        consume in class EnumValidator
        Parameters:
        data - left from the command which can be consumed
        Returns:
        the concatenated data consumed
      • getHelpText

        public String getHelpText()
        Get a proper help text for the console output
        Overrides:
        getHelpText in class EnumValidator
        Returns:
        help text for the console