package kotlin.reflect.jvm.internal.impl.resolve.constants;

import defpackage.cr4;
import defpackage.kp6;
import defpackage.pq6;
import kotlin.reflect.jvm.internal.impl.descriptors.ModuleDescriptor;
import kotlin.reflect.jvm.internal.impl.types.KotlinType;

/* JADX INFO: loaded from: classes3.dex */
public abstract class ConstantValue<T> {
    private final T value;

    public ConstantValue(T t) {
        this.value = t;
    }

    public boolean equals(@pq6 Object obj) {
        if (this == obj) {
            return true;
        }
        T value = getValue();
        ConstantValue constantValue = obj instanceof ConstantValue ? (ConstantValue) obj : null;
        return cr4.b(value, constantValue != null ? constantValue.getValue() : null);
    }

    @kp6
    public abstract KotlinType getType(@kp6 ModuleDescriptor moduleDescriptor);

    public T getValue() {
        return this.value;
    }

    public int hashCode() {
        T value = getValue();
        if (value != null) {
            return value.hashCode();
        }
        return 0;
    }

    @kp6
    public String toString() {
        return String.valueOf(getValue());
    }
}
