package com.tandbergtv.watchpoint.pmm.title.search;

import java.util.List;

import com.tandbergtv.workflow.driver.search.SearchOperator;
import com.tandbergtv.workflow.driver.search.SearchType;

public class SearchField {

	/* internal name of the field */
	private String name;

	/* list of values for that field */
	private List<String> values;

	/* data type of the field */
	private SearchType searchType;

	/* search operator for this field */
	private SearchOperator searchOperator;

	/* value, list or range type */
	private ParamType paramType;

	/*
	 * For metadata fields, this property defines the item type (e.g. MOVIE,
	 * POSTER...) to filter by
	 */
	private String sectionName; 
	
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the values
	 */
	public List<String> getValues() {
		return values;
	}

	/**
	 * @param values
	 *            the values to set
	 */
	public void setValues(List<String> values) {
		this.values = values;
	}

	/**
	 * @return the searchOperator
	 */
	public SearchOperator getSearchOperator() {
		return searchOperator;
	}

	/**
	 * @param searchOperator
	 *            the searchOperator to set
	 */
	public void setSearchOperator(SearchOperator searchOperator) {
		this.searchOperator = searchOperator;
	}

	/**
	 * @return the paramType
	 */
	public ParamType getParamType() {
		return paramType;
	}

	/**
	 * @param paramType
	 *            the paramType to set
	 */
	public void setParamType(ParamType paramType) {
		this.paramType = paramType;
	}

	/**
	 * @return the searchType
	 */
	public SearchType getSearchType() {
		return searchType;
	}

	/**
	 * @param searchType
	 *            the searchType to set
	 */
	public void setSearchType(SearchType searchType) {
		this.searchType = searchType;
	}

	public boolean isListParameter() {
		return getParamType() == ParamType.LIST;
	}

	public boolean isRangeParameter() {
		return getParamType() == ParamType.RANGE;
	}

	public boolean isValueParameter() {
		return getParamType() == ParamType.VALUE;
	}

	/**
	 * @return the sectionName
	 */
	public String getSectionName() {
		return sectionName;
	}

	/**
	 * @param sectionName the sectionName to set
	 */
	public void setSectionName(String sectionName) {
		this.sectionName = sectionName;
	}
}
