本文整理汇总了Java中io.reactivex.Notification.isOnNext方法的典型用法代码示例。如果您正苦于以下问题:Java Notification.isOnNext方法的具体用法?Java Notification.isOnNext怎么用?Java Notification.isOnNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.reactivex.Notification
的用法示例。
在下文中一共展示了Notification.isOnNext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calcNext
import io.reactivex.Notification; //导入方法依赖的package包/类
private void calcNext() {
if (completed) {
return;
}
if (next == null) {
Notification<T> take = uncheck(queue::take);
if (take.isOnNext()) {
next = take;
} else if (take.isOnError()) {
completed = true;
throw new RuntimeException(take.getError());
} else {
completed = true;
}
}
}
示例2: handleDevices
import io.reactivex.Notification; //导入方法依赖的package包/类
protected void handleDevices(Notification<String> deviceNotification) {
if (deviceNotification.isOnNext()) {
handleConnectedDevice(deviceNotification.getValue());
} else if (deviceNotification.isOnError()) {
handleNotConnectedDevice(deviceNotification.getError());
}
}
示例3: log
import io.reactivex.Notification; //导入方法依赖的package包/类
public static <T> Consumer<Notification<? super T>> log(String tag, String description) {
return (Notification<? super T> notification) -> {
if (notification.isOnNext()) {
Log.d(tag, description);
} else if (notification.isOnError()) {
Log.d(tag, description);
} else if (notification.isOnComplete()) {
Log.d(tag, description);
}
};
}
示例4: toTx
import io.reactivex.Notification; //导入方法依赖的package包/类
static <T> Flowable<Tx<T>> toTx(Notification<T> n, Connection con, Database db) {
if (n.isOnComplete())
return Flowable.just(new TxImpl<T>(con, null, null, true, db));
else if (n.isOnNext())
return Flowable.just(new TxImpl<T>(con, n.getValue(), null, false, db));
else
return Flowable.error(n.getError());
}
示例5: isValid
import io.reactivex.Notification; //导入方法依赖的package包/类
public static boolean isValid(OptionalView<?> view, Notification<?> notification) {
return view.view != null &&
(notification.isOnNext() || notification.isOnError());
}