java.lang.Object
org.apache.dubbo.rpc.cluster.router.condition.matcher.pattern.range.RangeValuePattern
All Implemented Interfaces:
ValuePattern

@Activate(order=100) public class RangeValuePattern extends Object implements ValuePattern
Matches with patterns like 'key=1~100', 'key=~100' or 'key=1~'
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    match(String pattern, String value, org.apache.dubbo.common.URL url, Invocation invocation, boolean isWhenCondition)
    Is the pattern matches with the request context
    boolean
    Is the input pattern of a specific form, for example, range pattern '1~100', wildcard pattern 'hello*', etc.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RangeValuePattern

      public RangeValuePattern()
  • Method Details

    • shouldMatch

      public boolean shouldMatch(String pattern)
      Description copied from interface: ValuePattern
      Is the input pattern of a specific form, for example, range pattern '1~100', wildcard pattern 'hello*', etc.
      Specified by:
      shouldMatch in interface ValuePattern
      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: ValuePattern
      Is the pattern matches with the request context
      Specified by:
      match in interface ValuePattern
      Parameters:
      pattern - pattern value extracted from condition rule
      value - the real value extracted from request context
      url - request context in consumer url
      invocation - request context in invocation
      isWhenCondition - condition type
      Returns:
      true if successfully match