package com.google.android.gms.measurement.internal; import android.os.Bundle; import com.google.android.gms.measurement.api.AppMeasurementSdk; /* loaded from: classes.dex */ public final class zzgz { public static Object zza(Bundle bundle, String str, Class cls, Object obj) { Object obj2 = bundle.get(str); if (obj2 == null) { return obj; } if (cls.isAssignableFrom(obj2.getClass())) { return obj2; } throw new IllegalStateException(String.format("Invalid conditional user property field type. '%s' expected [%s] but was [%s]", str, cls.getCanonicalName(), obj2.getClass().getCanonicalName())); } public static void zzb(Bundle bundle, Object obj) { if (obj instanceof Double) { bundle.putDouble(AppMeasurementSdk.ConditionalUserProperty.VALUE, ((Double) obj).doubleValue()); } else if (obj instanceof Long) { bundle.putLong(AppMeasurementSdk.ConditionalUserProperty.VALUE, ((Long) obj).longValue()); } else { bundle.putString(AppMeasurementSdk.ConditionalUserProperty.VALUE, obj.toString()); } } }