package com.sagacloud.utils.jsonHelper.search.searchInput;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

import org.apache.htrace.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * Created by wo on 8/22/17.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class SearchInput {
    private ArrayList<String> keywords;

    public ArrayList<String> getKeywords() { return this.keywords; }

    public void setKeywords(ArrayList<String> keywords) { this.keywords = keywords; }

    private String info_class;

    public String getInfo_class() { return this.info_class; }

    public void setInfo_class(String info_class) { this.info_class = info_class; }

    private ArrayList<String> category;

    public ArrayList<String> getCategory() { return this.category; }

    public void setCategory(ArrayList<String> category) { this.category = category; }

    private int limit = 10;

    public int getLimit() { return this.limit; }

    public void setLimit(int limit) { this.limit = limit; }

    private ArrayList<String> ids;

    public ArrayList<String> getIds() {
        return ids;
    }

    public void setIds(ArrayList<String> ids) {
        this.ids = ids;
    }
    
    //对象类型及业务标签编码关系 ["Eq_01","Eq_02","Sy_01","SyObj_02","BdObj_03"]
    private ArrayList<String> businessTag;

	public ArrayList<String> getBusinessTag() {
		return businessTag;
	}

	public void setBusinessTag(ArrayList<String> businessTag) {
		this.businessTag = businessTag;
	}
    public Set<String> getTagsByType(String type) {
    	Set<String> tags = new HashSet<>();
    	if(businessTag != null) {
    		for(String type_tag:businessTag) {
    			if(type_tag.startsWith(type)) {
    				tags.add(type_tag.split("_")[1]);
    			}
    		}
    	}
    	return tags;
    }
}
