package t4;

import java.util.NoSuchElementException;

/* JADX INFO: loaded from: classes.dex */
public final class d {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final d f32946b = new d();

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Object f32947a;

    public d() {
        this.f32947a = null;
    }

    public final Object a() {
        Object obj = this.f32947a;
        if (obj != null) {
            return obj;
        }
        throw new NoSuchElementException("No value present");
    }

    public final Object b() {
        Object obj = this.f32947a;
        if (obj != null) {
            return obj;
        }
        return null;
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof d)) {
            return false;
        }
        Object obj2 = ((d) obj).f32947a;
        Object obj3 = this.f32947a;
        if (obj3 != obj2) {
            return obj3 != null && obj3.equals(obj2);
        }
        return true;
    }

    public final int hashCode() {
        Object obj = this.f32947a;
        if (obj != null) {
            return obj.hashCode();
        }
        return 0;
    }

    public final String toString() {
        Object obj = this.f32947a;
        return obj != null ? String.format("Optional[%s]", obj) : "Optional.empty";
    }

    public d(Object obj) {
        obj.getClass();
        this.f32947a = obj;
    }
}
