File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
rxjava-core/src/main/java/rx Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ public class Notification<T> {
26
26
private final Throwable throwable ;
27
27
private final T value ;
28
28
29
+ private static final Notification <Void > ON_COMPLETED = new Notification <Void >(Kind .OnCompleted , null , null );
30
+
29
31
public static <T > Notification <T > createOnNext (T t ) {
30
32
return new Notification <T >(Kind .OnNext , t , null );
31
33
}
@@ -34,12 +36,14 @@ public static <T> Notification<T> createOnError(Throwable e) {
34
36
return new Notification <T >(Kind .OnError , null , e );
35
37
}
36
38
39
+ @ SuppressWarnings ("unchecked" )
37
40
public static <T > Notification <T > createOnCompleted () {
38
- return new Notification <T >( Kind . OnCompleted , null , null ) ;
41
+ return ( Notification <T >) ON_COMPLETED ;
39
42
}
40
43
44
+ @ SuppressWarnings ("unchecked" )
41
45
public static <T > Notification <T > createOnCompleted (Class <T > type ) {
42
- return new Notification <T >( Kind . OnCompleted , null , null ) ;
46
+ return ( Notification <T >) ON_COMPLETED ;
43
47
}
44
48
45
49
private Notification (Kind kind , T value , Throwable e ) {
You can’t perform that action at this time.
0 commit comments