Added missing annotations to react

This commit is contained in:
Anthony Restaino 2016-02-01 22:23:16 -05:00
parent e2d46bdae2
commit c4921bbf20
3 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,7 @@
package acr.browser.lightning.react;
import android.support.annotation.NonNull;
public interface Action<T> {
void onSubscribe(Subscriber<T> subscriber);
void onSubscribe(@NonNull Subscriber<T> subscriber);
}

View File

@ -18,12 +18,12 @@ import acr.browser.lightning.utils.Preconditions;
*/
public class Observable<T> {
private Action<T> mAction;
@NonNull private Action<T> mAction;
@Nullable private Executor mSubscriber;
@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;
Looper looper = Looper.myLooper();
Preconditions.checkNonNull(looper);

View File

@ -1,6 +1,7 @@
package acr.browser.lightning.react;
import android.os.Looper;
import android.support.annotation.NonNull;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
@ -9,10 +10,12 @@ public class Schedulers {
private static final Executor sWorker = Executors.newCachedThreadPool();
private static final Executor sMain = new ThreadExecutor(Looper.getMainLooper());
@NonNull
public static Executor worker() {
return sWorker;
}
@NonNull
public static Executor main() {
return sMain;
}