package com.uas.search.b2b.model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 分页参数
 * 
 * @author suntg
 * @since 2016年8月3日下午9:10:47
 */
public class PageParams implements Serializable {

	/**
	 * 序列号
	 */
	private static final long serialVersionUID = 1L;
	private int page;
	private int size;

	/**
	 * keyword模糊搜索的字段名称
	 */
	private List<String> keywordSearchColumns;

	private Map<String, Object> filters;
	private Map<String, Object> notEqualFilters;

	public PageParams() {

	}

	public PageParams(int page, int size, Map<String, Object> filters) {
		this.page = page;
		this.size = size;
		this.filters = filters;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public List<String> getKeywordSearchColumns() {
		return keywordSearchColumns;
	}

	public void setKeywordSearchColumns(List<String> keywordSearchColumns) {
		this.keywordSearchColumns = keywordSearchColumns;
	}

	public Map<String, Object> getFilters() {
		return filters;
	}

	public void setFilters(Map<String, Object> filters) {
		this.filters = filters;
	}

	public void filter(String key, Object value) {
		if (this.filters == null) {
			this.filters = new HashMap<String, Object>();
		}
		this.filters.put(key, value);
	}

	public void removeFilter(String key) {
		if (this.filters != null) {
			this.filters.remove(key);
		}
	}

	public Map<String, Object> getNotEqualFilters() {
		return notEqualFilters;
	}

	public void setNotEqualFilters(Map<String, Object> notEqualFilters) {
		this.notEqualFilters = notEqualFilters;
	}

	@Override
	public String toString() {
		return "PageParams [page=" + page + ", size=" + size + ", keywordSearchColumns=" + keywordSearchColumns
				+ ", filters=" + filters + ", notEqualFilters=" + notEqualFilters + "]";
	}

}
