package org.hcjf.layers.query;

import java.util.Arrays;
import java.util.Collection;
import java.util.Map;

/**
 * @author javaito
 * @mail javaito@gmail.com
 */
public class In extends FieldEvaluator {

    public In(String fieldName, Object value) {
        super(fieldName, value);
    }

    @Override
    public boolean evaluate(Object object, Query.Consumer consumer) {
        boolean result = false;

        try {
            Object fieldValue = consumer.get(object, getFieldName());
            if(Map.class.isAssignableFrom(fieldValue.getClass())) {
                result = ((Map)fieldValue).containsKey(getValue());
            } else if(Collection.class.isAssignableFrom(fieldValue.getClass())) {
                result = ((Collection)fieldValue).contains(getValue());
            } else if(fieldValue.getClass().isArray()) {
                result = Arrays.binarySearch((Object[])fieldValue, getValue()) >= 0;
            } else if(String.class.isAssignableFrom(fieldValue.getClass())) {
                result = ((String)fieldValue).contains(getValue().toString());
            }
        } catch (Exception ex) {
            throw new IllegalArgumentException("In evaluator fail", ex);
        }

        return result;
    }
}

@@ -940,23 +940,171 @@
  else if
-(String
+ (Map.class.isAssignableFrom(getValue().getClass())) %7B%0A                result = ((Map)getValue()).containsKey(fieldValue);%0A            %7D else if(Collection
 .class.i
@@ -1115,34 +1115,34 @@
 ignableFrom(
-field
+get
 Value
+()
 .getClass())
@@ -1176,25 +1176,29 @@
 = ((
-String)field
+Collection)get
 Value
+()
 ).co
@@ -1208,30 +1208,161 @@
 ins(
-getValue().toString())
+fieldValue);%0A            %7D else if(getValue().getClass().isArray()) %7B%0A                result = Arrays.binarySearch((Object%5B%5D)getValue(), fieldValue) %3E= 0
 ;%0A  

Resolve in over array values