mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-03 03:00:23 +01:00
33 lines
1.1 KiB
Java
33 lines
1.1 KiB
Java
package io.reactivex.rxjava3.disposables;
|
|
|
|
import io.reactivex.rxjava3.annotations.NonNull;
|
|
import java.util.Objects;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes18.dex */
|
|
abstract class ReferenceDisposable<T> extends AtomicReference<T> implements Disposable {
|
|
private static final long serialVersionUID = 6537757548749041217L;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public ReferenceDisposable(T t) {
|
|
super(t);
|
|
Objects.requireNonNull(t, "value is null");
|
|
}
|
|
|
|
@Override // io.reactivex.rxjava3.disposables.Disposable
|
|
public final void dispose() {
|
|
T andSet;
|
|
if (get() == null || (andSet = getAndSet(null)) == null) {
|
|
return;
|
|
}
|
|
onDisposed(andSet);
|
|
}
|
|
|
|
@Override // io.reactivex.rxjava3.disposables.Disposable
|
|
public final boolean isDisposed() {
|
|
return get() == null;
|
|
}
|
|
|
|
public abstract void onDisposed(@NonNull T t);
|
|
}
|