Package org.smartparam.engine.matchers
Class BetweenMatcher
java.lang.Object
org.smartparam.engine.matchers.BetweenMatcher
- All Implemented Interfaces:
Matcher
Range matcher, checks if value fits in range defined in pattern. Value type and pattern type must also match. It is possible to define range inclusiveness or exclusiveness, separately for each of range border value.
Between matcher has a set of default separators, that will be used to separate values for beginning and end of range. These separators are (order matters):: - ,First separator that was found in pattern string is used to split it. Use
setSeparators(java.lang.String) to override defaults.- Since:
- 0.9.0
- Author:
- Przemek Hertel
-
Constructor Summary
ConstructorsConstructorDescriptionBetweenMatcher(boolean lowerInclusive, boolean upperInclusive) BetweenMatcher(boolean lowerInclusive, boolean upperInclusive, String separators) BetweenMatcher(String lowerInclusive, String upperInclusive) BetweenMatcher(String lowerInclusive, String upperInclusive, String separators) -
Method Summary
Modifier and TypeMethodDescription<T extends ValueHolder>
booleanCheck if value matches the pattern.final voidsetLowerInclusive(boolean lowerInclusive) final voidsetSeparators(String separators) Override default separators.final voidsetUpperInclusive(boolean upperInclusive) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.smartparam.engine.core.matcher.Matcher
isReverse, setReverse
-
Constructor Details
-
BetweenMatcher
-
BetweenMatcher
-
BetweenMatcher
- Parameters:
lowerInclusive- range lower end should be inclusive?upperInclusive- range upper end should be inclusive?separators- separators to use
-
BetweenMatcher
public BetweenMatcher(boolean lowerInclusive, boolean upperInclusive) - Parameters:
lowerInclusive- range lower end should be inclusive?upperInclusive- range upper end should be inclusive?
-
-
Method Details
-
matches
Description copied from interface:MatcherCheck if value matches the pattern. Type can be used to parse value or to differentiate matchers behavior depending on value type. Type is defined per parameterLevel. -
setLowerInclusive
public final void setLowerInclusive(boolean lowerInclusive) -
setUpperInclusive
public final void setUpperInclusive(boolean upperInclusive) -
setSeparators
Override default separators. Provided string is split into char array and each character is treated as a single separator.- Parameters:
separators- string value of separator
-