/**
 * Copyright 2010-2013 Ralph Schaer <ralphschaer@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ch.ralscha.extdirectspring.filter;

import java.util.NoSuchElementException;

public enum Comparison {
	LESS_THAN("lt"), LESS_THAN_OR_EQUAL("lte"), GREATER_THAN("gt"), GREATER_THAN_OR_EQUAL("gte"), EQUAL("eq"), NOT_EQUAL(
			"ne"), LIKE("like"), IN("in");

	private final String name;

	private Comparison(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public static Comparison fromString(String name) {
		for (Comparison comparison : Comparison.values()) {
			if (comparison.getName().equalsIgnoreCase(name)) {
				return comparison;
			}
		}
		throw new NoSuchElementException(name + " not found");
	}

}

@@ -661,16 +661,42 @@
 ilter;%0A%0A
+import java.util.HashSet;%0A
 import j
@@ -727,16 +727,38 @@
 ception;
+%0Aimport java.util.Set;
 %0A%0Apublic
@@ -791,16 +791,21 @@
 HAN(%22lt%22
+, %22%3C%22
 ), LESS_
@@ -823,16 +823,22 @@
 AL(%22lte%22
+, %22%3C=%22
 ), GREAT
@@ -849,16 +849,21 @@
 HAN(%22gt%22
+, %22%3E%22
 ), GREAT
@@ -884,16 +884,22 @@
 AL(%22gte%22
+, %22%3E=%22
 ), EQUAL
@@ -903,11 +903,20 @@
 UAL(
-%22eq
+%0A%09%09%09%22eq%22, %22=
 %22), 
@@ -929,15 +929,17 @@
 UAL(
-%0A%09%09%09%22ne
+%22ne%22, %22!=
 %22), 
@@ -978,27 +978,42 @@
 e final 
+Set%3C
 String
- name
+%3E externalValues
 ;%0A%0A%09priv
@@ -1037,139 +1037,393 @@
 ring
- name) %7B%0A%09%09this.name = name;%0A%09%7D%0A%0A%09public String getName() %7B%0A%09%09return name;%0A%09%7D%0A%0A%09public static Comparison fromString(String name) %7B%0A
+... values) %7B%0A%09%09externalValues = new HashSet%3CString%3E();%0A%09%09for (String value : values) %7B%0A%09%09%09externalValues.add(value);%0A%09%09%7D%0A%09%7D%0A%0A%09public boolean is(String externalValue) %7B%0A%09%09return externalValues.contains(externalValue);%0A%09%7D%0A%0A%09public static Comparison fromString(String externalValue) %7B%0A%09%09if (externalValue != null) %7B%0A%09%09%09final String externalValueLowerCase = externalValue.toLowerCase();%0A%09
 %09%09fo
@@ -1475,16 +1475,17 @@
 )) %7B%0A%09%09%09
+%09
 if (comp
@@ -1495,44 +1495,39 @@
 son.
-getName().equalsIgnoreCase(nam
+is(externalValueLowerCas
 e)) %7B%0A
+%09
 %09%09%09%09
@@ -1545,16 +1545,22 @@
 arison;%0A
+%09%09%09%09%7D%0A
 %09%09%09%7D%0A%09%09%7D
@@ -1599,25 +1599,63 @@
 ion(
-nam
+%22Comparison value: '%22 + externalValu
 e + %22
+'
  not 
-foun
+supporte
 d%22);
@@ -1660,9 +1660,8 @@
 );%0A%09%7D%0A%0A%7D
-%0A

Add support for characters <,<=,=,>=,>,!= ExtJs supports these characters in the operator field http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.util.Filter-cfg-operator