package com.google.android.gms.measurement.internal;

import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.Nullable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Constructor;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Field;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Param;

/* JADX INFO: loaded from: classes2.dex */
public final class i4 extends f8.a {
    public static final Parcelable.Creator<i4> CREATOR = new l4(0);

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final int f21665a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final String f21666b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final long f21667c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final String f21668d;

    @Nullable
    @SafeParcelable$Field(id = 4)
    public final Long zzc;

    @Nullable
    @SafeParcelable$Field(id = 6)
    public final String zzd;

    @Nullable
    @SafeParcelable$Field(id = 8)
    public final Double zzf;

    @SafeParcelable$Constructor
    public i4(@SafeParcelable$Param(id = 1) int i10, @SafeParcelable$Param(id = 2) String str, @SafeParcelable$Param(id = 3) long j10, @Nullable @SafeParcelable$Param(id = 4) Long l10, @SafeParcelable$Param(id = 5) Float f10, @Nullable @SafeParcelable$Param(id = 6) String str2, @SafeParcelable$Param(id = 7) String str3, @Nullable @SafeParcelable$Param(id = 8) Double d10) {
        this.f21665a = i10;
        this.f21666b = str;
        this.f21667c = j10;
        this.zzc = l10;
        if (i10 == 1) {
            this.zzf = f10 != null ? Double.valueOf(f10.doubleValue()) : null;
        } else {
            this.zzf = d10;
        }
        this.zzd = str2;
        this.f21668d = str3;
    }

    @Override // android.os.Parcelable
    public final void writeToParcel(Parcel parcel, int i10) {
        int I = com.bumptech.glide.g.I(20293, parcel);
        com.bumptech.glide.g.C(parcel, 1, 4);
        parcel.writeInt(this.f21665a);
        com.bumptech.glide.g.r(parcel, 2, this.f21666b);
        com.bumptech.glide.g.C(parcel, 3, 8);
        parcel.writeLong(this.f21667c);
        Long l10 = this.zzc;
        if (l10 != null) {
            com.bumptech.glide.g.C(parcel, 4, 8);
            parcel.writeLong(l10.longValue());
        }
        com.bumptech.glide.g.r(parcel, 6, this.zzd);
        com.bumptech.glide.g.r(parcel, 7, this.f21668d);
        Double d10 = this.zzf;
        if (d10 != null) {
            com.bumptech.glide.g.C(parcel, 8, 8);
            parcel.writeDouble(d10.doubleValue());
        }
        com.bumptech.glide.g.N(I, parcel);
    }

    @Nullable
    public final Object zza() {
        Long l10 = this.zzc;
        if (l10 != null) {
            return l10;
        }
        Double d10 = this.zzf;
        if (d10 != null) {
            return d10;
        }
        String str = this.zzd;
        if (str != null) {
            return str;
        }
        return null;
    }

    public i4(String str, long j10, @Nullable Object obj, String str2) {
        com.google.android.gms.common.internal.w.checkNotEmpty(str);
        this.f21665a = 2;
        this.f21666b = str;
        this.f21667c = j10;
        this.f21668d = str2;
        if (obj == null) {
            this.zzc = null;
            this.zzf = null;
            this.zzd = null;
            return;
        }
        if (obj instanceof Long) {
            this.zzc = (Long) obj;
            this.zzf = null;
            this.zzd = null;
        } else if (obj instanceof String) {
            this.zzc = null;
            this.zzf = null;
            this.zzd = (String) obj;
        } else {
            if (obj instanceof Double) {
                this.zzc = null;
                this.zzf = (Double) obj;
                this.zzd = null;
                return;
            }
            throw new IllegalArgumentException("User attribute given of un-supported type");
        }
    }

    public i4(k4 k4Var) {
        this(k4Var.f21712c, k4Var.f21713d, k4Var.f21714e, k4Var.f21711b);
    }
}
