Exemplo n.º 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;
    }
Exemplo n.º 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;
      }
    }
Exemplo n.º 3
0
 @Override
 public boolean matching(String target) {
   return matcher.matching(target);
 }