package eu.socialsensor.framework.common.domain;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class Query implements JSONable{

	public Query(){
		
	}
	
	public Query(String name,Double score){
		this.name = name;
		this.score = score;
	}
	
	@Expose
    @SerializedName(value = "name")
    protected String name;
	
	@Expose
    @SerializedName(value = "score")
    protected Double score;
	
	@Expose
    @SerializedName(value = "type")
    protected Type type;
	
	@Expose
    @SerializedName(value = "coords")
    protected Double[] coords;
	
	public String getName(){
		return name;
	}
	
	public void setName(String name){
		this.name = name;
	}
	
	public Double getScore(){
		return score;
	}
	
	public void setScore(Double score){
		this.score = score;
	}
	
	public Type getType(){
		return type;
	}
	
	public void setType(Type type){
		this.type = type;
	}
	
	public void setLocationCoords(Double[] coords){
		this.coords = coords;
	}
	
	public Double[] getLocationCoords(){
		return this.coords;
	}
	
 	@Override
    public String toJSONString() {
        Gson gson = new GsonBuilder()
                .excludeFieldsWithoutExposeAnnotation()
                //.registerTypeAdapter(Date.class, new DateSerializer())
                //.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
                .create();
        return gson.toJson(this);
    }
 	
 	public enum Type{
 		Keywords, TwitterUsers, TwitterMentions, TwitterList, Location, URL, Contributors
 	}

}

@@ -689,24 +689,129 @@
 coords;%0D%0A%09%0D%0A
+%09@Expose%0D%0A    @SerializedName(value = %22fromExpansion%22)%0D%0A    protected boolean fromExpansion = false;%0D%0A%09%0D%0A
 %09public Stri
@@ -1293,16 +1293,195 @@
 %0A%09%7D%0D%0A%09%0D%0A
+%09public void setIsFromExpansion(boolean fromExpansion)%7B%0D%0A%09%09this.fromExpansion = fromExpansion;%0D%0A%09%7D%0D%0A%09%0D%0A%09public boolean getIsFromExpansion()%7B%0D%0A%09%09return this.fromExpansion;%0D%0A%09%7D%0D%0A%09%0D%0A
  %09@Overr

add is from expansion value