Files
rr3-apk/decompiled/sources/com/google/firebase/perf/util/ImmutableBundle.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

72 lines
2.1 KiB
Java

package com.google.firebase.perf.util;
import android.os.Bundle;
import com.google.firebase.perf.logging.AndroidLogger;
/* loaded from: classes3.dex */
public final class ImmutableBundle {
public static final AndroidLogger logger = AndroidLogger.getInstance();
public final Bundle bundle;
public ImmutableBundle() {
this(new Bundle());
}
public ImmutableBundle(Bundle bundle) {
this.bundle = (Bundle) bundle.clone();
}
public boolean containsKey(String str) {
return str != null && this.bundle.containsKey(str);
}
public Optional getBoolean(String str) {
if (!containsKey(str)) {
return Optional.absent();
}
try {
return Optional.fromNullable((Boolean) this.bundle.get(str));
} catch (ClassCastException e) {
logger.debug("Metadata key %s contains type other than boolean: %s", str, e.getMessage());
return Optional.absent();
}
}
public Optional getDouble(String str) {
if (!containsKey(str)) {
return Optional.absent();
}
Object obj = this.bundle.get(str);
if (obj == null) {
return Optional.absent();
}
if (obj instanceof Float) {
return Optional.of(Double.valueOf(((Float) obj).doubleValue()));
}
if (obj instanceof Double) {
return Optional.of((Double) obj);
}
logger.debug("Metadata key %s contains type other than double: %s", str);
return Optional.absent();
}
public Optional getLong(String str) {
if (getInt(str).isAvailable()) {
return Optional.of(Long.valueOf(((Integer) r3.get()).intValue()));
}
return Optional.absent();
}
public final Optional getInt(String str) {
if (!containsKey(str)) {
return Optional.absent();
}
try {
return Optional.fromNullable((Integer) this.bundle.get(str));
} catch (ClassCastException e) {
logger.debug("Metadata key %s contains type other than int: %s", str, e.getMessage());
return Optional.absent();
}
}
}