Enum EmptyComponent
- java.lang.Object
-
- java.lang.Enum<EmptyComponent>
-
- io.reactivex.rxjava3.internal.util.EmptyComponent
-
- All Implemented Interfaces:
CompletableObserver
,FlowableSubscriber<java.lang.Object>
,MaybeObserver<java.lang.Object>
,Observer<java.lang.Object>
,SingleObserver<java.lang.Object>
,Disposable
,java.io.Serializable
,java.lang.Comparable<EmptyComponent>
,org.reactivestreams.Subscriber<java.lang.Object>
,org.reactivestreams.Subscription
public enum EmptyComponent extends java.lang.Enum<EmptyComponent> implements FlowableSubscriber<java.lang.Object>, Observer<java.lang.Object>, MaybeObserver<java.lang.Object>, SingleObserver<java.lang.Object>, CompletableObserver, org.reactivestreams.Subscription, Disposable
Singleton implementing many interfaces as empty.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
EmptyComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Observer<T>
asObserver()
static <T> org.reactivestreams.Subscriber<T>
asSubscriber()
void
cancel()
void
dispose()
Dispose the resource, the operation should be idempotent.boolean
isDisposed()
Returns true if this resource has been disposed.void
onComplete()
Notifies theObserver
that theObservable
has finished sending push-based notifications.void
onError(java.lang.Throwable t)
Notifies theObserver
that theObservable
has experienced an error condition.void
onNext(java.lang.Object t)
Provides theObserver
with a new item to observe.void
onSubscribe(Disposable d)
Provides theObserver
with the means of cancelling (disposing) the connection (channel) with theObservable
in both synchronous (from withinObserver.onNext(Object)
) and asynchronous manner.void
onSubscribe(org.reactivestreams.Subscription s)
Implementors of this method should make sure everything that needs to be visible inSubscriber.onNext(Object)
is established before callingSubscription.request(long)
.void
onSuccess(java.lang.Object value)
Notifies theMaybeObserver
with one item and that theMaybe
has finished sending push-based notifications.void
request(long n)
static EmptyComponent
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static EmptyComponent[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final EmptyComponent INSTANCE
-
-
Method Detail
-
values
public static EmptyComponent[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EmptyComponent c : EmptyComponent.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EmptyComponent valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
asSubscriber
public static <T> org.reactivestreams.Subscriber<T> asSubscriber()
-
asObserver
public static <T> Observer<T> asObserver()
-
dispose
public void dispose()
Description copied from interface:Disposable
Dispose the resource, the operation should be idempotent.- Specified by:
dispose
in interfaceDisposable
-
isDisposed
public boolean isDisposed()
Description copied from interface:Disposable
Returns true if this resource has been disposed.- Specified by:
isDisposed
in interfaceDisposable
- Returns:
- true if this resource has been disposed
-
request
public void request(long n)
- Specified by:
request
in interfaceorg.reactivestreams.Subscription
-
cancel
public void cancel()
- Specified by:
cancel
in interfaceorg.reactivestreams.Subscription
-
onSubscribe
public void onSubscribe(Disposable d)
Description copied from interface:Observer
Provides theObserver
with the means of cancelling (disposing) the connection (channel) with theObservable
in both synchronous (from withinObserver.onNext(Object)
) and asynchronous manner.- Specified by:
onSubscribe
in interfaceCompletableObserver
- Specified by:
onSubscribe
in interfaceMaybeObserver<java.lang.Object>
- Specified by:
onSubscribe
in interfaceObserver<java.lang.Object>
- Specified by:
onSubscribe
in interfaceSingleObserver<java.lang.Object>
- Parameters:
d
- theDisposable
instance whoseDisposable.dispose()
can be called anytime to cancel the connection
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s)
Description copied from interface:FlowableSubscriber
Implementors of this method should make sure everything that needs to be visible inSubscriber.onNext(Object)
is established before callingSubscription.request(long)
. In practice this means no initialization should happen after therequest()
call and additional behavior is thread safe in respect toonNext
.- Specified by:
onSubscribe
in interfaceFlowableSubscriber<java.lang.Object>
- Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<java.lang.Object>
-
onNext
public void onNext(java.lang.Object t)
Description copied from interface:Observer
Provides theObserver
with a new item to observe.The
Observable
may call this method 0 or more times.The
Observable
will not call this method again after it calls eitherObserver.onComplete()
orObserver.onError(java.lang.Throwable)
.
-
onError
public void onError(java.lang.Throwable t)
Description copied from interface:Observer
Notifies theObserver
that theObservable
has experienced an error condition.If the
Observable
calls this method, it will not thereafter callObserver.onNext(T)
orObserver.onComplete()
.- Specified by:
onError
in interfaceCompletableObserver
- Specified by:
onError
in interfaceMaybeObserver<java.lang.Object>
- Specified by:
onError
in interfaceObserver<java.lang.Object>
- Specified by:
onError
in interfaceSingleObserver<java.lang.Object>
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<java.lang.Object>
- Parameters:
t
- the exception encountered by the Observable
-
onComplete
public void onComplete()
Description copied from interface:Observer
Notifies theObserver
that theObservable
has finished sending push-based notifications.The
Observable
will not call this method if it callsObserver.onError(java.lang.Throwable)
.- Specified by:
onComplete
in interfaceCompletableObserver
- Specified by:
onComplete
in interfaceMaybeObserver<java.lang.Object>
- Specified by:
onComplete
in interfaceObserver<java.lang.Object>
- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<java.lang.Object>
-
onSuccess
public void onSuccess(java.lang.Object value)
Description copied from interface:MaybeObserver
Notifies theMaybeObserver
with one item and that theMaybe
has finished sending push-based notifications.The
Maybe
will not call this method if it callsMaybeObserver.onError(java.lang.Throwable)
.- Specified by:
onSuccess
in interfaceMaybeObserver<java.lang.Object>
- Specified by:
onSuccess
in interfaceSingleObserver<java.lang.Object>
- Parameters:
value
- the item emitted by theMaybe
-
-