jimu-decompiled/sources/io/reactivex/internal/disposables/EmptyDisposable.java
2025-05-13 19:24:51 +02:00

85 lines
2.4 KiB
Java

package io.reactivex.internal.disposables;
import io.reactivex.CompletableObserver;
import io.reactivex.MaybeObserver;
import io.reactivex.Observer;
import io.reactivex.SingleObserver;
import io.reactivex.internal.fuseable.QueueDisposable;
/* loaded from: classes2.dex */
public enum EmptyDisposable implements QueueDisposable<Object> {
INSTANCE,
NEVER;
public static void complete(Observer<?> observer) {
observer.onSubscribe(INSTANCE);
observer.onComplete();
}
public static void error(Throwable th, Observer<?> observer) {
observer.onSubscribe(INSTANCE);
observer.onError(th);
}
@Override // io.reactivex.internal.fuseable.SimpleQueue
public void clear() {
}
@Override // io.reactivex.disposables.Disposable
public void dispose() {
}
public boolean isDisposed() {
return this == INSTANCE;
}
@Override // io.reactivex.internal.fuseable.SimpleQueue
public boolean isEmpty() {
return true;
}
@Override // io.reactivex.internal.fuseable.SimpleQueue
public boolean offer(Object obj) {
throw new UnsupportedOperationException("Should not be called!");
}
@Override // io.reactivex.internal.fuseable.SimpleQueue
public Object poll() throws Exception {
return null;
}
@Override // io.reactivex.internal.fuseable.QueueFuseable
public int requestFusion(int i) {
return i & 2;
}
public boolean offer(Object obj, Object obj2) {
throw new UnsupportedOperationException("Should not be called!");
}
public static void complete(MaybeObserver<?> maybeObserver) {
maybeObserver.onSubscribe(INSTANCE);
maybeObserver.onComplete();
}
public static void error(Throwable th, CompletableObserver completableObserver) {
completableObserver.onSubscribe(INSTANCE);
completableObserver.onError(th);
}
public static void complete(CompletableObserver completableObserver) {
completableObserver.onSubscribe(INSTANCE);
completableObserver.onComplete();
}
public static void error(Throwable th, SingleObserver<?> singleObserver) {
singleObserver.onSubscribe(INSTANCE);
singleObserver.onError(th);
}
public static void error(Throwable th, MaybeObserver<?> maybeObserver) {
maybeObserver.onSubscribe(INSTANCE);
maybeObserver.onError(th);
}
}