Class GlobMatcher<T>
- java.lang.Object
-
- org.soulwing.prospecto.jaxrs.runtime.glob.GlobMatcher<T>
-
public class GlobMatcher<T> extends Object
A type-generalized pattern matcher supporting "glob" expressions.A glob pattern is a sequence of values of type
T. Among these values, two values are distinguished:- a symbol that is interpreted in a given pattern to mean match any single value in the input
- a symbol that is interpreted in a given pattern to mean match any sequence of input (including an empty sequence)
An input sequence of values of type
Tis matched against the pattern by interpreting each value of the input and the pattern in order, applying either equals, match-any, or match-any-sequence according to the pattern specification.When the base type is
Characterand the match any symbol is "?" and the match any sequence is "*", theGlobMatchertakes on the semantics of ordinary filename globbing for string (character array) inputs.- Author:
- Carl Harris
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatches(List<T> input)Tests the given input as a match for this pattern.booleanmatches(T[] input)Tests the given input as a match for this pattern.static <T> GlobMatcher<T>with(T anyInputToken, T anyInputSequenceToken, T[] pattern)
-
-
-
Method Detail
-
with
public static <T> GlobMatcher<T> with(T anyInputToken, T anyInputSequenceToken, T[] pattern)
-
matches
public boolean matches(T[] input)
Tests the given input as a match for this pattern.- Parameters:
input- the input to test- Returns:
trueifinputmatches this pattern
-
-