Enum Class GlobberStrategy

java.lang.Object
java.lang.Enum<GlobberStrategy>
org.eclipse.sisu.space.GlobberStrategy
All Implemented Interfaces:
Serializable, Comparable<GlobberStrategy>, Constable

enum GlobberStrategy extends Enum<GlobberStrategy>
Enumerates various optimized filename globbing strategies.
  • Enum Constant Details

  • Constructor Details

    • GlobberStrategy

      private GlobberStrategy()
  • Method Details

    • values

      public static GlobberStrategy[] 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 GlobberStrategy 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
    • selectFor

      static final GlobberStrategy selectFor(String glob)
      Selects the optimal globber strategy for the given plain-text glob.
      Parameters:
      glob - The plain-text glob
      Returns:
      Optimal globber strategy
    • compile

      abstract Object compile(String glob)
      Compiles the given plain-text glob into an optimized pattern.
      Parameters:
      glob - The plain-text glob
      Returns:
      Compiled glob pattern
    • matches

      abstract boolean matches(Object globPattern, String filename)
      Attempts to match the given compiled glob pattern against a filename.
      Parameters:
      globPattern - The compiled glob pattern
      filename - The candidate filename
      Returns:
      true if the pattern matches; otherwise false
    • basename

      static final String basename(String filename)
      Extracts the basename segment from the given filename.
      Parameters:
      filename - The filename
      Returns:
      Basename segment