public final class Command<I,R> extends java.lang.Object implements ICommand<I,R>
I
and returns R.apply(Object)| Constructor and Description |
|---|
Command(rx.functions.Func1<I,rx.Observable<R>> createObservable)
Creates a Command.
|
Command(IProperty<java.lang.Boolean> enabled,
rx.functions.Func1<I,rx.Observable<R>> createObservable)
Creates a Command.
|
| Modifier and Type | Method and Description |
|---|---|
rx.Observable<R> |
apply()
Invokes
ICommand.apply(Object) with null. |
rx.Observable<R> |
apply(I input)
Applies the receiver returning an
Observable which when subscribed,
will execute the command with input and forwards the results. |
protected void |
finalize() |
rx.Observable<java.lang.Throwable> |
getErrors()
An Observable of all errors that occur in the receiver.
|
rx.Observable<rx.Notification<R>> |
getNotifications()
An Observable of all
Notification that occur in the receiver. |
rx.Observable<R> |
getValues()
An Observable of Values generated from applications of the receiver.
|
IProperty<java.lang.Boolean> |
isEnabled()
Whether or not the receiver is enabled.
|
IProperty<java.lang.Boolean> |
isExecuting()
Whether or not the receiver is executing.
|
public Command(rx.functions.Func1<I,rx.Observable<R>> createObservable)
createObservable - Function used to create an Observable each time apply(Object) is invoked.public Command(IProperty<java.lang.Boolean> enabled, rx.functions.Func1<I,rx.Observable<R>> createObservable)
enabled - Property whether or not this Command should be enabled.createObservable - Function used to create an Observable each time apply(Object) is invoked.public rx.Observable<R> apply()
ICommandICommand.apply(Object) with null.public rx.Observable<R> apply(I input)
Observable which when subscribed,
will execute the command with input and forwards the results.
If Command is executing or not enabled,
an Observable with error CommandNotEnabledException is returned.
Note: In case the Observable emits an error, Implementing Error handler is not required.
aka. OnErrorNotImplementedException will be ignored since errors are forwarded on getErrors()public rx.Observable<rx.Notification<R>> getNotifications()
Notification that occur in the receiver.getNotifications in interface ICommand<I,R>public rx.Observable<R> getValues()
public IProperty<java.lang.Boolean> isEnabled()
public IProperty<java.lang.Boolean> isExecuting()
isExecuting in interface ICommand<I,R>public rx.Observable<java.lang.Throwable> getErrors()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable