package androidx.databinding;

import androidx.lifecycle.u;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;

/* loaded from: classes.dex */
class o extends WeakReference {

    /* renamed from: a, reason: collision with root package name */
    private final k f4017a;

    /* renamed from: b, reason: collision with root package name */
    protected final int f4018b;

    /* renamed from: c, reason: collision with root package name */
    private Object f4019c;

    public o(n nVar, int i10, k kVar, ReferenceQueue referenceQueue) {
        super(nVar, referenceQueue);
        this.f4018b = i10;
        this.f4017a = kVar;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    /* JADX WARN: Multi-variable type inference failed */
    public n a() {
        n nVar = (n) get();
        if (nVar == null) {
            e();
        }
        return nVar;
    }

    public Object b() {
        return this.f4019c;
    }

    public void c(u uVar) {
        this.f4017a.a(uVar);
    }

    public void d(Object obj) {
        e();
        this.f4019c = obj;
        if (obj != null) {
            this.f4017a.c(obj);
        }
    }

    public boolean e() {
        boolean z10;
        Object obj = this.f4019c;
        if (obj != null) {
            this.f4017a.b(obj);
            z10 = true;
        } else {
            z10 = false;
        }
        this.f4019c = null;
        return z10;
    }
}
