package cn.com.pc.penguin.service;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.*;

/**
 * Created by IntelliJ IDEA.
 * User: huangqinghe
 * To change this template use File | Settings | File Templates.
 */
public class PenguinSearchResults {
    private int total; //total number
	private List<String> lists = new ArrayList<String>(); //current page result
	//obtainValue
	private List<String> valueLists = new ArrayList<String>();

	public List<String> getValueLists() {
		return valueLists;
	}
	public void setValueLists(List<String> valueLists) {
		this.valueLists = valueLists;
	}

	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public List<String> getLists() {
		return lists;
	}
	public void setLists(List<String> lists) {
		this.lists = lists;
	}

    public String toJSON() throws Exception {
		JSONObject result = new JSONObject();
		result.put("total", this.getTotal());
		JSONArray lists = new JSONArray();
		for(String id : this.getLists()) {
			lists.put(id);
		}
		result.put("lists", lists);

		return result.toString();
	}


}
