jimu-decompiled/sources/com/ubtrobot/analytics/Event.java
2025-05-13 19:24:51 +02:00

184 lines
5.4 KiB
Java

package com.ubtrobot.analytics;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes2.dex */
public class Event implements Parcelable {
public static final Parcelable.Creator<Event> CREATOR = new Parcelable.Creator<Event>() { // from class: com.ubtrobot.analytics.Event.1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public Event createFromParcel(Parcel parcel) {
return new Event(parcel);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public Event[] newArray(int i) {
return new Event[i];
}
};
private String category;
private Map<String, String> customSegmentation;
private long duration;
private String eventId;
private long recordedAt;
private Map<String, String> segmentation;
private String userId;
private String version;
public static class Builder {
private String a;
private String b;
private String c;
private String d;
private long e;
private long f = System.currentTimeMillis() / 1000;
private Map<String, String> g;
private Map<String, String> h;
public Builder(String str, String str2) {
this.a = str;
this.c = str2;
}
public Builder a(String str) {
this.b = str;
return this;
}
public Builder b(String str) {
this.d = str;
return this;
}
public String toString() {
return "Event.Builder{eventId='" + this.a + "', userId='" + this.b + "', category='" + this.c + "', version='" + this.d + "', duration=" + this.e + ", recordedAt=" + this.f + ", segmentation=" + this.g + ", customSegmentation=" + this.h + '}';
}
public Builder a(long j) {
this.e = j;
return this;
}
public Builder b(long j) {
this.f = j / 1000;
return this;
}
public Builder a(Map<String, String> map) {
this.h = map;
return this;
}
public Builder b(Map<String, String> map) {
this.g = map;
return this;
}
public Event a() {
Event event = new Event(this.a, this.c);
event.userId = this.b;
event.version = this.d;
event.duration = this.e;
event.recordedAt = this.f;
Map map = this.g;
if (map == null) {
map = new HashMap();
}
event.segmentation = map;
Map map2 = this.h;
if (map2 == null) {
map2 = new HashMap();
}
event.customSegmentation = map2;
return event;
}
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public String getCategory() {
return this.category;
}
public Map<String, String> getCustomSegmentation() {
return this.customSegmentation;
}
public long getDuration() {
return this.duration;
}
public String getEventId() {
return this.eventId;
}
public long getRecordedAt() {
return this.recordedAt;
}
public Map<String, String> getSegmentation() {
return this.segmentation;
}
public String getUserId() {
return this.userId;
}
public String getVersion() {
return this.version;
}
public String toString() {
return "Event{eventId='" + this.eventId + "', userId='" + this.userId + "', category='" + this.category + "', version='" + this.version + "', duration=" + this.duration + ", recordedAt=" + this.recordedAt + ", segmentation=" + this.segmentation + ", customSegmentation=" + this.customSegmentation + '}';
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(this.eventId);
parcel.writeString(this.userId);
parcel.writeString(this.category);
parcel.writeString(this.version);
parcel.writeLong(this.duration);
parcel.writeLong(this.recordedAt);
parcel.writeByte((byte) (this.segmentation == null ? 0 : 1));
Map<String, String> map = this.segmentation;
if (map != null) {
parcel.writeMap(map);
}
parcel.writeByte((byte) (this.customSegmentation != null ? 1 : 0));
Map<String, String> map2 = this.customSegmentation;
if (map2 != null) {
parcel.writeMap(map2);
}
}
private Event(String str, String str2) {
this.eventId = str;
this.category = str2;
}
private Event(Parcel parcel) {
this.eventId = parcel.readString();
this.userId = parcel.readString();
this.category = parcel.readString();
this.version = parcel.readString();
this.duration = parcel.readLong();
this.recordedAt = parcel.readLong();
if (parcel.readByte() != 0) {
this.segmentation = new HashMap();
parcel.readMap(this.segmentation, String.class.getClassLoader());
}
if (parcel.readByte() != 0) {
this.customSegmentation = new HashMap();
parcel.readMap(this.customSegmentation, String.class.getClassLoader());
}
}
}