alexandroid/decompiled/jadx/sources/com/google/common/base/Defaults.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

48 lines
1.3 KiB
Java

package com.google.common.base;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@J2ktIncompatible
@GwtIncompatible
/* loaded from: classes8.dex */
public final class Defaults {
private static final Double DOUBLE_DEFAULT = Double.valueOf(0.0d);
private static final Float FLOAT_DEFAULT = Float.valueOf(0.0f);
private Defaults() {
}
public static <T> T defaultValue(Class<T> cls) {
Preconditions.checkNotNull(cls);
if (!cls.isPrimitive()) {
return null;
}
if (cls == Boolean.TYPE) {
return (T) Boolean.FALSE;
}
if (cls == Character.TYPE) {
return (T) (char) 0;
}
if (cls == Byte.TYPE) {
return (T) (byte) 0;
}
if (cls == Short.TYPE) {
return (T) (short) 0;
}
if (cls == Integer.TYPE) {
return (T) 0;
}
if (cls == Long.TYPE) {
return (T) 0L;
}
if (cls == Float.TYPE) {
return (T) FLOAT_DEFAULT;
}
if (cls == Double.TYPE) {
return (T) DOUBLE_DEFAULT;
}
return null;
}
}