Added missing annotations to react
This commit is contained in:
parent
e2d46bdae2
commit
c4921bbf20
@ -1,5 +1,7 @@
|
|||||||
package acr.browser.lightning.react;
|
package acr.browser.lightning.react;
|
||||||
|
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
public interface Action<T> {
|
public interface Action<T> {
|
||||||
void onSubscribe(Subscriber<T> subscriber);
|
void onSubscribe(@NonNull Subscriber<T> subscriber);
|
||||||
}
|
}
|
||||||
|
@ -18,12 +18,12 @@ import acr.browser.lightning.utils.Preconditions;
|
|||||||
*/
|
*/
|
||||||
public class Observable<T> {
|
public class Observable<T> {
|
||||||
|
|
||||||
private Action<T> mAction;
|
@NonNull private Action<T> mAction;
|
||||||
@Nullable private Executor mSubscriber;
|
@Nullable private Executor mSubscriber;
|
||||||
@Nullable private Executor mObserver;
|
@Nullable private Executor mObserver;
|
||||||
private final Executor mDefault;
|
@NonNull private final Executor mDefault;
|
||||||
|
|
||||||
public Observable(Action<T> action) {
|
public Observable(@NonNull Action<T> action) {
|
||||||
mAction = action;
|
mAction = action;
|
||||||
Looper looper = Looper.myLooper();
|
Looper looper = Looper.myLooper();
|
||||||
Preconditions.checkNonNull(looper);
|
Preconditions.checkNonNull(looper);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package acr.browser.lightning.react;
|
package acr.browser.lightning.react;
|
||||||
|
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
@ -9,10 +10,12 @@ public class Schedulers {
|
|||||||
private static final Executor sWorker = Executors.newCachedThreadPool();
|
private static final Executor sWorker = Executors.newCachedThreadPool();
|
||||||
private static final Executor sMain = new ThreadExecutor(Looper.getMainLooper());
|
private static final Executor sMain = new ThreadExecutor(Looper.getMainLooper());
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public static Executor worker() {
|
public static Executor worker() {
|
||||||
return sWorker;
|
return sWorker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public static Executor main() {
|
public static Executor main() {
|
||||||
return sMain;
|
return sMain;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user