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