/* ===================================================================
 * IngredientCriteriaImpl.java
 * 
 * Created Sep 25, 2004 7:42:13 PM
 * 
 * Copyright (c) 2004 Matt Magoffin (spamsqr@msqr.us)
 * 
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License as 
 * published by the Free Software Foundation; either version 2 of 
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
 * 02111-1307 USA
 * ===================================================================
 * $Id: IngredientCriteriaImpl.java 52 2009-05-08 07:43:29Z msqr $
 * ===================================================================
 */

package magoffin.matt.ieat.util;

import magoffin.matt.ieat.biz.RecipeSearchBiz.IngredientCriteria;

/**
 * Implementation of IngredientCriteria.
 * 
 * @author Matt Magoffin (spamsqr@msqr.us)
 * @version $Revision: 52 $ $Date: 2009-05-08 19:43:29 +1200 (Fri, 08 May 2009) $
 */
public class IngredientCriteriaImpl implements IngredientCriteria {
	
	private String ingredientName;
	private boolean approximateSearch;
	private boolean countOnly;
	
	/**
	 * Default constructor.
	 */
	public IngredientCriteriaImpl() {
		this(null);
	}
	
	/**
	 * Construct with a name.
	 * 
	 * <p>The <code>approximateSearch</code> value will be set to <em>true</em>.</p>
	 * @param ingredientName the ingredient name to search for
	 */
	public IngredientCriteriaImpl(String ingredientName) {
		this.ingredientName = ingredientName;
		this.approximateSearch = true;
	}
	
	@Override
	public String toString() {
		return "IngredientCriteria{ingredientName=" +ingredientName +"}";
	}

	public boolean useApproximateSearch() {
		return isApproximateSearch();
	}
	
	/**
	 * @return the ingredientName
	 */
	public String getIngredientName() {
		return ingredientName;
	}

	/**
	 * @param ingredientName the ingredientName to set
	 */
	public void setIngredientName(String ingredientName) {
		this.ingredientName = ingredientName;
	}

	/**
	 * @return the approximateSearch
	 */
	public boolean isApproximateSearch() {
		return approximateSearch;
	}

	/**
	 * @param approximateSearch the approximateSearch to set
	 */
	public void setApproximateSearch(boolean approximateSearch) {
		this.approximateSearch = approximateSearch;
	}

	/**
	 * @return the countOnly
	 */
	public boolean isCountOnly() {
		return countOnly;
	}

	/**
	 * @param countOnly the countOnly to set
	 */
	public void setCountOnly(boolean countOnly) {
		this.countOnly = countOnly;
	}

}
