Interface RegexPredicate<T>
- Type Parameters:
T- the type of data you want to filter
- All Superinterfaces:
Predicate<T>
Interface used as a data filter to search for files by regular expression
-
Method Summary
Modifier and TypeMethodDescriptionGet predicate patterndefault booleanDetermines whether to inspect the full path or just the filenameGenerate instance ofRegexPredicateGenerate instance ofRegexPredicatedefault booleanEvaluates this predicate on the given argument.default booleanEvaluates this predicate on the given argument.default booleanEvaluates this predicate on the given argument.default booleantestZipEntry(@NotNull ZipEntry entry) Evaluates this predicate on the given argument.
-
Method Details
-
of
@NotNull static <T> @NotNull Predicate<T> of(boolean fullPath, @NotNull @RegExp @NotNull String regex) Generate instance ofRegexPredicate- Type Parameters:
T- predicate object type- Parameters:
fullPath- determines whether to inspect the full path or just the filenameregex- regular expression to check each element- Returns:
- a configured instance of
RegexPredicate
-
of
Generate instance ofRegexPredicate- Type Parameters:
T- predicate object type- Parameters:
regex- regular expression to check each element- Returns:
- a configured instance of
RegexPredicate
-
getPattern
Pattern getPattern()Get predicate pattern- Returns:
- compiled regex predicate
-
isFullPathInspect
default boolean isFullPathInspect()Determines whether to inspect the full path or just the filename- Returns:
trueif the full path is inspected orfalseif only the file name is inspected
-
test
Evaluates this predicate on the given argument. -
testPath
Evaluates this predicate on the given argument.- Parameters:
path- the input argument- Returns:
trueif the input argument matches the predicate, otherwisefalse
-
testFile
Evaluates this predicate on the given argument.- Parameters:
file- the input argument- Returns:
trueif the input argument matches the predicate, otherwisefalse
-
testZipEntry
Evaluates this predicate on the given argument.- Parameters:
entry- the input argument- Returns:
trueif the input argument matches the predicate, otherwisefalse
-