Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Netflix/RxJava into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMGross committed Feb 5, 2014
2 parents ab94a0b + 64f20f9 commit 73dd109
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rxjava-core/src/main/java/rx/Notification.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class Notification<T> {
private final Throwable throwable;
private final T value;

private static final Notification<Void> ON_COMPLETED = new Notification<Void>(Kind.OnCompleted, null, null);

public static <T> Notification<T> createOnNext(T t) {
return new Notification<T>(Kind.OnNext, t, null);
}
Expand All @@ -34,12 +36,14 @@ public static <T> Notification<T> createOnError(Throwable e) {
return new Notification<T>(Kind.OnError, null, e);
}

@SuppressWarnings("unchecked")
public static <T> Notification<T> createOnCompleted() {
return new Notification<T>(Kind.OnCompleted, null, null);
return (Notification<T>) ON_COMPLETED;
}

@SuppressWarnings("unchecked")
public static <T> Notification<T> createOnCompleted(Class<T> type) {
return new Notification<T>(Kind.OnCompleted, null, null);
return (Notification<T>) ON_COMPLETED;
}

private Notification(Kind kind, T value, Throwable e) {
Expand Down

0 comments on commit 73dd109

Please sign in to comment.