class ContextQueryConfig extends FilterConfig {

   @Override
   public Condition generate(Map<String, Object> values) {
      Preconditions.checkArgument(getCondition() != null, "Must specify a delegate condition");
      Preconditions.checkArgument(matcher != null, "Must specify a matcher");
      
      Predicate<Model> selectorPred = Predicates.alwaysTrue();
      if(selector != null) {
         selectorPred = FunctionFactory.toModelPredicate(selector.toTemplate(), values);
      }
      Predicate<Model> matcherPred = FunctionFactory.toModelPredicate(matcher.toTemplate(), values);
      Condition condition = getCondition().generate(values);
      
      return new MatcherFilter(condition, new ModelPredicateMatcher(selectorPred, matcherPred));
   }

}