예제 #1
0
    @Override
    public boolean matching(String target) {

      // and
      if (relation.equals(RelationEnum.AND)) {
        for (Matcher matcher : matcherList) {
          if (!matcher.matching(target)) {
            return false;
          }
        }
        return true;
      }

      // or
      else if (relation.equals(RelationEnum.OR)) {
        for (Matcher matcher : matcherList) {
          if (matcher.matching(target)) {
            return true;
          }
        }
        return false;
      }

      // others
      return false;
    }
예제 #2
0
    @Override
    public boolean matching(String target) {

      final Boolean valueInCache = cacheMap.get(target);
      if (null == valueInCache) {
        final boolean value = matcher.matching(target);
        cacheMap.put(target, value);
        return value;
      } else {
        return valueInCache;
      }
    }
예제 #3
0
 @Override
 public boolean matching(String target) {
   return matcher.matching(target);
 }