Package org.eclipse.sisu.space
Enum Class GlobberStrategy
- All Implemented Interfaces:
Serializable
,Comparable<GlobberStrategy>
,Constable
Enumerates various optimized filename globbing strategies.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static final String
Extracts the basename segment from the given filename.(package private) abstract Object
Compiles the given plain-text glob into an optimized pattern.(package private) abstract boolean
Attempts to match the given compiled glob pattern against a filename.(package private) static final GlobberStrategy
Selects the optimal globber strategy for the given plain-text glob.static GlobberStrategy
Returns the enum constant of this class with the specified name.static GlobberStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ANYTHING
-
SUFFIX
-
PREFIX
-
EXACT
-
PATTERN
-
-
Constructor Details
-
GlobberStrategy
private GlobberStrategy()
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
selectFor
Selects the optimal globber strategy for the given plain-text glob.- Parameters:
glob
- The plain-text glob- Returns:
- Optimal globber strategy
-
compile
Compiles the given plain-text glob into an optimized pattern.- Parameters:
glob
- The plain-text glob- Returns:
- Compiled glob pattern
-
matches
Attempts to match the given compiled glob pattern against a filename.- Parameters:
globPattern
- The compiled glob patternfilename
- The candidate filename- Returns:
true
if the pattern matches; otherwisefalse
-
basename
Extracts the basename segment from the given filename.- Parameters:
filename
- The filename- Returns:
- Basename segment
-