Class RangeValuePattern
java.lang.Object
org.apache.dubbo.rpc.cluster.router.condition.matcher.pattern.range.RangeValuePattern
- All Implemented Interfaces:
ValuePattern
Matches with patterns like 'key=1~100', 'key=~100' or 'key=1~'
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatch(String pattern, String value, org.apache.dubbo.common.URL url, Invocation invocation, boolean isWhenCondition) Is the pattern matches with the request contextbooleanshouldMatch(String pattern) Is the input pattern of a specific form, for example, range pattern '1~100', wildcard pattern 'hello*', etc.
-
Constructor Details
-
RangeValuePattern
public RangeValuePattern()
-
-
Method Details
-
shouldMatch
Description copied from interface:ValuePatternIs the input pattern of a specific form, for example, range pattern '1~100', wildcard pattern 'hello*', etc.- Specified by:
shouldMatchin interfaceValuePattern- Parameters:
pattern- the match or mismatch pattern- Returns:
- true or false
-
match
public boolean match(String pattern, String value, org.apache.dubbo.common.URL url, Invocation invocation, boolean isWhenCondition) Description copied from interface:ValuePatternIs the pattern matches with the request context- Specified by:
matchin interfaceValuePattern- Parameters:
pattern- pattern value extracted from condition rulevalue- the real value extracted from request contexturl- request context in consumer urlinvocation- request context in invocationisWhenCondition- condition type- Returns:
- true if successfully match
-