AnalyticsEventBuilder.java
4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
package com.bitstrips.imoji.analytics;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.bitstrips.imoji.experiments.Experiments;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.json.JSONObject;
public class AnalyticsEventBuilder
{
private final Category a;
private Long b;
private Action c;
private String d;
private Long e;
private AnalyticsWrapper f;
private final Experiments g;
public AnalyticsEventBuilder(@NonNull Category paramCategory, @NonNull Action paramAction, @NonNull Experiments paramExperiments)
{
this.a = paramCategory;
this.c = paramAction;
this.b = Long.valueOf(System.currentTimeMillis());
this.g = paramExperiments;
}
public AnalyticsEvent build()
{
if ((this.f != null) && (this.d != null)) {
throw new IllegalArgumentException("analtyics wrapper and label can't both be present");
}
if ((this.d == null) && (this.e != null)) {
throw new IllegalArgumentException("must have label if value is present");
}
AnalyticsEvent localAnalyticsEvent = new AnalyticsEvent(this.a, this.c, this.b, (byte)0);
if (this.f != null) {
localAnalyticsEvent.setLabel(new JSONObject(this.f.buildMap()).toString());
}
for (;;)
{
if (this.e != null) {
localAnalyticsEvent.setValue(this.e);
}
localAnalyticsEvent.setExperimentIds(this.g.getExperimentIds());
return localAnalyticsEvent;
if (this.d != null) {
localAnalyticsEvent.setLabel(this.d);
}
}
}
public AnalyticsEventBuilder withAnalyticsWrapper(@NonNull AnalyticsWrapper paramAnalyticsWrapper)
{
this.f = paramAnalyticsWrapper;
return this;
}
public AnalyticsEventBuilder withLabel(@NonNull String paramString)
{
this.d = paramString;
return this;
}
public AnalyticsEventBuilder withValue(@NonNull Long paramLong)
{
this.e = paramLong;
return this;
}
public class AnalyticsEvent
implements Serializable
{
@SerializedName("category")
Category a;
@SerializedName("action")
Action b;
@SerializedName("avatarId")
String c;
@SerializedName("timestamp")
Long d;
@SerializedName("label")
String e;
@SerializedName("value")
Long f;
@SerializedName("appId")
Integer g;
@SerializedName("has_snapchat_installed")
Boolean h;
@SerializedName("session_id")
String i;
@SerializedName("experimentIds")
int[] j;
@SerializedName("sequence_id")
int k;
@SerializedName("retry_count")
int l;
private AnalyticsEvent(@NonNull Category paramCategory, @NonNull Action paramAction, @NonNull Long paramLong)
{
this.a = paramCategory;
this.b = paramAction;
this.d = paramLong;
this.l = -1;
}
public boolean equals(Object paramObject)
{
if (!(paramObject instanceof AnalyticsEvent)) {
return false;
}
paramObject = (AnalyticsEvent)paramObject;
return new EqualsBuilder().append(this.k, ((AnalyticsEvent)paramObject).k).append(this.i, ((AnalyticsEvent)paramObject).i).append(this.c, ((AnalyticsEvent)paramObject).c).append(this.d, ((AnalyticsEvent)paramObject).d).build().booleanValue();
}
public Category getCategory()
{
return this.a;
}
public int getRetryCount()
{
return this.l;
}
public boolean hasBeenLogged()
{
return this.l != -1;
}
public int hashCode()
{
int i1 = this.k;
int n = i1;
if (this.i != null) {
n = i1 + this.i.hashCode();
}
return n;
}
public void incrementRetryCount()
{
this.l += 1;
}
public void setAppId(@NonNull Integer paramInteger)
{
this.g = paramInteger;
}
public void setAvatarId(@Nullable String paramString)
{
this.c = paramString;
}
public void setExperimentIds(int[] paramArrayOfInt)
{
this.j = ((int[])paramArrayOfInt.clone());
}
public void setHasSnapchatInstalled(boolean paramBoolean)
{
this.h = Boolean.valueOf(paramBoolean);
}
public void setLabel(@NonNull String paramString)
{
this.e = paramString;
}
public void setSequenceId(int paramInt)
{
this.k = paramInt;
}
public void setSessionId(String paramString)
{
this.i = paramString;
}
public void setValue(@Nullable Long paramLong)
{
this.f = paramLong;
}
public String toString()
{
return super.toString();
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/analytics/AnalyticsEventBuilder.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/