package com.ss.android.ugc.aweme.framework.services;

import com.bytedance.covode.number.Covode;
import java.util.Objects;

public final class Defaults {
    public static final Double DOUBLE_DEFAULT = Double.valueOf(0.0d);
    public static final Float FLOAT_DEFAULT = Float.valueOf(0.0f);

    static {
        Covode.recordClassIndex(81068);
    }

    public static <T> T requireNonNull(T t) {
        Objects.requireNonNull(t);
        return t;
    }

    public static <T> T defaultValue(Class<T> cls) {
        requireNonNull(cls);
        if (cls == Boolean.TYPE) {
            return Boolean.FALSE;
        }
        if (cls == Character.TYPE) {
            return 0;
        }
        if (cls == Byte.TYPE) {
            return (byte) 0;
        }
        if (cls == Short.TYPE) {
            return (short) 0;
        }
        if (cls == Integer.TYPE) {
            return 0;
        }
        if (cls == Long.TYPE) {
            return 0L;
        }
        if (cls == Float.TYPE) {
            return FLOAT_DEFAULT;
        }
        if (cls == Double.TYPE) {
            return DOUBLE_DEFAULT;
        }
        return null;
    }
}
