AnalyticsWrapper.java 2.35 KB
package com.bitstrips.imoji.analytics;

import com.bitstrips.imoji.models.Sticker;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;

public class AnalyticsWrapper
  implements Serializable
{
  private String a;
  private String b;
  private String c;
  private String d;
  private String e;
  private SearchSource f = null;
  private String g;
  private int h = -1;
  private boolean i = false;
  
  public Map<String, String> buildMap()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("share_from", "DEFAULT");
    if (this.d != null) {
      localHashMap.put("comic_id", this.d);
    }
    if (this.c != null) {
      localHashMap.put("template_id", this.c);
    }
    if (this.a != null) {
      localHashMap.put("supertag", this.a);
    }
    if (this.b != null) {
      localHashMap.put("search_term", this.b);
    }
    if (this.f != null) {
      localHashMap.put("search_type", this.f.toString());
    }
    if (this.e != null) {
      localHashMap.put("share_to", this.e);
    }
    if (this.g != null) {
      localHashMap.put("search_term", this.g);
    }
    if (this.h >= 0) {
      localHashMap.put("result_count", String.valueOf(this.h));
    }
    if (this.i) {
      localHashMap.put("share_type", "attach");
    }
    return localHashMap;
  }
  
  public AnalyticsWrapper labelForImojiShare(Sticker paramSticker, String paramString)
  {
    this.a = paramString;
    this.c = paramSticker.getTemplateId();
    this.d = paramSticker.getComicId();
    return this;
  }
  
  public AnalyticsWrapper labelForSearchSubmit(String paramString, int paramInt)
  {
    this.g = paramString;
    this.h = paramInt;
    return this;
  }
  
  public AnalyticsWrapper setIsAttach()
  {
    this.i = true;
    return this;
  }
  
  public AnalyticsWrapper setShareTo(String paramString)
  {
    this.e = paramString;
    return this;
  }
  
  public String toString()
  {
    return new JSONObject(buildMap()).toString();
  }
  
  public AnalyticsWrapper updateLabelForSearch(String paramString, SearchSource paramSearchSource)
  {
    this.a = "#search";
    this.b = paramString;
    this.f = paramSearchSource;
    return this;
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/analytics/AnalyticsWrapper.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */