/** * Constructs an onNext notification containing the given value. * @param <T> the value type * @param value the value to carry around in the notification, not null * @return the new Notification instance * @throws NullPointerException if value is null */ @NonNull public static <T> Notification<T> createOnNext(@NonNull T value) { ObjectHelper.requireNonNull(value, "value is null"); return new Notification<T>(value); }
/** * Constructs an onNext notification containing the given value. * @param <T> the value type * @param value the value to carry around in the notification, not null * @return the new Notification instance * @throws NullPointerException if value is null */ @NonNull public static <T> Notification<T> createOnNext(@NonNull T value) { ObjectHelper.requireNonNull(value, "value is null"); return new Notification<T>(value); }
/** * Constructs an onNext notification containing the given value. * @param <T> the value type * @param value the value to carry around in the notification, not null * @return the new Notification instance * @throws NullPointerException if value is null */ @NonNull public static <T> Notification<T> createOnNext(@NonNull T value) { ObjectHelper.requireNonNull(value, "value is null"); return new Notification<T>(value); }
/** * Constructs an onError notification containing the error. * @param <T> the value type * @param error the error Throwable to carry around in the notification, not null * @return the new Notification instance * @throws NullPointerException if error is null */ @NonNull public static <T> Notification<T> createOnError(@NonNull Throwable error) { ObjectHelper.requireNonNull(error, "error is null"); return new Notification<T>(error(error)); }
/** * Constructs an onError notification containing the error. * @param <T> the value type * @param error the error Throwable to carry around in the notification, not null * @return the new Notification instance * @throws NullPointerException if error is null */ @NonNull public static <T> Notification<T> createOnError(@NonNull Throwable error) { ObjectHelper.requireNonNull(error, "error is null"); return new Notification<T>(error(error)); }
/** * Constructs an onError notification containing the error. * @param <T> the value type * @param error the error Throwable to carry around in the notification, not null * @return the new Notification instance * @throws NullPointerException if error is null */ @NonNull public static <T> Notification<T> createOnError(@NonNull Throwable error) { ObjectHelper.requireNonNull(error, "error is null"); return new Notification<T>(error(error)); }