Class CommandFlags

java.lang.Object
de.redstoneworld.redutilities.input.CommandFlags

public class CommandFlags extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isFlag(String[] args, String flag, int arg)
    This method checks whether the specified flag was found for the target argument.
    static boolean
    isFlag(String[] args, String flag, int minArg, int maxArg)
    This method checks whether the specified flag was found for the target arguments.
    static boolean
    isHideFlag(String cmdInput)
    This method checks if the given argument is the flag for hiding the teleport message.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CommandFlags

      public CommandFlags()
  • Method Details

    • isHideFlag

      public static boolean isHideFlag(String cmdInput)
      This method checks if the given argument is the flag for hiding the teleport message.
    • isFlag

      public static boolean isFlag(String[] args, String flag, int arg)
      This method checks whether the specified flag was found for the target argument. The use of wildcards (*) is supported for the end of the string. This is useful for flags with arguments (Example: '-target:*').
      Parameters:
      args - The array with the command argument input
      flag - The flag to be checked
      arg - The number (Array index) of the argument to be analysed
      Returns:
      (Boolean) 'true', if the flag was found here
    • isFlag

      public static boolean isFlag(String[] args, String flag, int minArg, int maxArg)
      This method checks whether the specified flag was found for the target arguments. The use of wildcards (*) is supported for the end of the string. This is useful for flags with arguments (Example: '-target:*').
      Parameters:
      args - The array with the command argument input
      flag - The flag to be checked
      minArg - The minimal number (Array index) of the arguments to be analysed
      maxArg - The maximal number (Array index) of the arguments to be analysed
      Returns:
      (Boolean) 'true', if the flag was found here