// Path: src/src/com/orm/androrm/statement/InStatement.java
// public class InStatement extends Statement {
// 
// 	private List<Object> mValues;
// 	
// 	public InStatement(String key, List<Object> values) {
// 		mKey = key;
// 		mValues = values;
// 	}
// 	
// 	private String getList() {
// 		return StringUtils.join(mValues, "','");
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return mKey + " IN ('" + getList() + "')";
// 	}
// 	
// }
// 
// Path: src/src/com/orm/androrm/statement/Statement.java
// public class Statement {
// 	
// 	/**
// 	 * Key of the statement.
// 	 */
// 	protected String mKey;
// 	/**
// 	 * Key of the statement.
// 	 */
// 	protected String mOperator;
// 	/**
// 	 * Value of the statement.
// 	 */
// 	protected String mValue;
// 	
// 	/**
// 	 * Empty constructor.
// 	 */
// 	public Statement() {}
// 	
// 	public Statement(String key, int value) {
// 		mKey = key;
// 		mOperator = "=";
// 		mValue = String.valueOf(value);
// 	}
// 
// 	public Statement(String key, String operator, int value) {
// 		mKey = key;
// 		mOperator = operator;
// 		mValue = String.valueOf(value);
// 	}
// 	
// 	/**
// 	 * This constructor sets the key and value field of this 
// 	 * statement.
// 	 * 
// 	 * @param key Database column.
// 	 * @param value Expected value of this column.
// 	 */
// 	public Statement(String key, String value) {
// 		mKey = key;
// 		mOperator = "=";
// 		mValue = value;
// 	}
// 
// 	public Statement(String key, String operator, String value) {
// 		mKey = key;
// 		mOperator = operator;
// 		mValue = value;
// 	}
// 	
// 	/**
// 	 * Get all keys that are used in this statement.
// 	 * 
// 	 * @return All keys i.e. the affected database columns.
// 	 */
// 	public Set<String> getKeys() {
// 		Set<String> keys = new HashSet<String>();
// 		keys.add(mKey);
// 		
// 		return keys;
// 	}
// 	
// 	public void setKey(String key) {
// 		mKey = key;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return mKey + " " + mOperator + " '" + mValue + "'";
// 	}
// }


import java.util.ArrayList;
import java.util.List;
import com.orm.androrm.statement.InStatement;
import com.orm.androrm.statement.LikeStatement;
import com.orm.androrm.statement.Statement;
	 * Retrieves the last field in the chain, 
	 * to gather the correct field name for the 
	 * statement. 
	 * 
	 * @param sequence	List of field names separated by __
	 * @return The last field name in the chain.
	 */
	private String getFieldName(String sequence) {
		String[] fields = sequence.split("__");
		
		return fields[fields.length - 1];
	}
	
	public List<Rule> getRules() {
		return mRules;
	}
	
	/**
	 * Use this function, if you want the value of the field
	 * to be in the {@link List} of values you hand in. 
	 * <br /><br />
	 * 
	 * This can either be a list of {@link Integer integers} or 
	 * a list of model classes. (Classes inheriting from {@link Model})
	 * 
	 * @param key		Chain to the field.
	 * @param values	{@link List} of values.
	 * @return	<code>this</code> for chaining.
	 */
	public Filter in(String key, List<?> values) {
// Path: src/src/com/orm/androrm/statement/InStatement.java
// public class InStatement extends Statement {
// 
// 	private List<Object> mValues;
// 	
// 	public InStatement(String key, List<Object> values) {
// 		mKey = key;
// 		mValues = values;
// 	}
// 	
// 	private String getList() {
// 		return StringUtils.join(mValues, "','");
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return mKey + " IN ('" + getList() + "')";
// 	}
// 	
// }
// 
// Path: src/src/com/orm/androrm/statement/Statement.java
// public class Statement {
// 	
// 	/**
// 	 * Key of the statement.
// 	 */
// 	protected String mKey;
// 	/**
// 	 * Key of the statement.
// 	 */
// 	protected String mOperator;
// 	/**
// 	 * Value of the statement.
// 	 */
// 	protected String mValue;
// 	
// 	/**
// 	 * Empty constructor.
// 	 */
// 	public Statement() {}
// 	
// 	public Statement(String key, int value) {
// 		mKey = key;
// 		mOperator = "=";
// 		mValue = String.valueOf(value);
// 	}
// 
// 	public Statement(String key, String operator, int value) {
// 		mKey = key;
// 		mOperator = operator;
// 		mValue = String.valueOf(value);
// 	}
// 	
// 	/**
// 	 * This constructor sets the key and value field of this 
// 	 * statement.
// 	 * 
// 	 * @param key Database column.
// 	 * @param value Expected value of this column.
// 	 */
// 	public Statement(String key, String value) {
// 		mKey = key;
// 		mOperator = "=";
// 		mValue = value;
// 	}
// 
// 	public Statement(String key, String operator, String value) {
// 		mKey = key;
// 		mOperator = operator;
// 		mValue = value;
// 	}
// 	
// 	/**
// 	 * Get all keys that are used in this statement.
// 	 * 
// 	 * @return All keys i.e. the affected database columns.
// 	 */
// 	public Set<String> getKeys() {
// 		Set<String> keys = new HashSet<String>();
// 		keys.add(mKey);
// 		
// 		return keys;
// 	}
// 	
// 	public void setKey(String key) {
// 		mKey = key;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return mKey + " " + mOperator + " '" + mValue + "'";
// 	}
// }


// Path: src/src/com/orm/androrm/Filter.java
import java.util.ArrayList;
import java.util.List;
import com.orm.androrm.statement.InStatement;
import com.orm.androrm.statement.LikeStatement;
import com.orm.androrm.statement.Statement;

	 * Retrieves the last field in the chain, 
	 * to gather the correct field name for the 
	 * statement. 
	 * 
	 * @param sequence	List of field names separated by __
	 * @return The last field name in the chain.
	 */
	private String getFieldName(String sequence) {
		String[] fields = sequence.split("__");
		
		return fields[fields.length - 1];
	}
	
	public List<Rule> getRules() {
		return mRules;
	}
	
	/**
	 * Use this function, if you want the value of the field
	 * to be in the {@link List} of values you hand in. 
	 * <br /><br />
	 * 
	 * This can either be a list of {@link Integer integers} or 
	 * a list of model classes. (Classes inheriting from {@link Model})
	 * 
	 * @param key		Chain to the field.
	 * @param values	{@link List} of values.
	 * @return	<code>this</code> for chaining.
	 */
	public Filter in(String key, List<?> values) {
		mRules.add(new Rule(key, new InStatement(getFieldName(key), filterValues(values))));