Enum Class ArgsFilter

java.lang.Object
java.lang.Enum<ArgsFilter>
org.refcodes.cli.ArgsFilter
All Implemented Interfaces:
Serializable, Comparable<ArgsFilter>, Constable

public enum ArgsFilter extends Enum<ArgsFilter>
Enumeration declaring command line argument filter.
  • Enum Constant Details

    • D

      public static final ArgsFilter D
      Java system properties are to be filtered.
    • D_XX

      public static final ArgsFilter D_XX
      Matches D as well as XX.
    • NONE

      public static final ArgsFilter NONE
      No arguments are filtered.
    • XX

      public static final ArgsFilter XX
      JVM command-line options that are specified with -XX: are not checked for validity.
  • Method Details

    • values

      public static ArgsFilter[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ArgsFilter valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromFilter

      public List<String> fromFilter(List<String> aArgs)
      Filters the provided args by including the args matching this enumerations criteria. (opposite of toFiltered(List).
      Parameters:
      aArgs - The args to be filtered.
      Returns:
      The filtered args.
    • fromFilter

      public String[] fromFilter(String[] aArgs)
      Filters the provided args by including the args matching this enumerations criteria. (opposite of toFiltered(String[])
      Parameters:
      aArgs - The args to be filtered.
      Returns:
      The filtered args.
    • getFilter

      public Pattern getFilter()
      Returns the args Pattern used to filter (exclude) the according args.
      Returns:
      The according filter Pattern.
    • toFiltered

      public List<String> toFiltered(List<String> aArgs)
      Filters the provided args by excluding (filtering) the args matching this enumerations criteria.
      Parameters:
      aArgs - The args to be filtered.
      Returns:
      The filtered args.
    • toFiltered

      public String[] toFiltered(String[] aArgs)
      Filters the provided args by excluding (filtering) the args matching this enumerations criteria.
      Parameters:
      aArgs - The args to be filtered.
      Returns:
      The filtered args.
    • fromFilter

      public static List<String> fromFilter(List<String> aArgs, Pattern aArgsFilter)
      Filters the provided args by including the args matching the provided Pattern (opposite of toFiltered(List, Pattern).
      Parameters:
      aArgs - The args to be filtered.
      aArgsFilter - The Pattern to be used for filtering.
      Returns:
      The filtered args.
    • fromFilter

      public static String[] fromFilter(String[] aArgs, Pattern aArgsFilter)
      Filters the provided args by including the args matching the provided Pattern (opposite of toFiltered(String[], Pattern).
      Parameters:
      aArgs - The args to be filtered.
      aArgsFilter - The Pattern to be used for filtering.
      Returns:
      The filtered args.
    • toArgsFilter

      public static ArgsFilter toArgsFilter(String aValue)
      Retrieves a ArgsFilter depending on the given string, ignoring the case as well as being graceful regarding "-" and "_",.
      Parameters:
      aValue - The name of the ArgsFilter to be interpreted graceful.
      Returns:
      The ArgsFilter being determined or null if none was found.
    • toFiltered

      public static List<String> toFiltered(List<String> aArgs, Pattern aArgsFilter)
      Filters the provided args by excluding (filtering) the args matching the provided Pattern.
      Parameters:
      aArgs - The args to be filtered.
      aArgsFilter - The Pattern to be used for filtering.
      Returns:
      The filtered args.
    • toFiltered

      public static String[] toFiltered(String[] aArgs, Pattern aArgsFilter)
      Filters the provided args by excluding (filtering) the args matching the provided Pattern.
      Parameters:
      aArgs - The args to be filtered.
      aArgsFilter - The Pattern to be used for filtering.
      Returns:
      The filtered args.