2020
2121import io .reactivex .Observer ;
2222import io .reactivex .Scheduler ;
23+ import io .reactivex .annotations .CheckReturnValue ;
2324import io .reactivex .disposables .Disposable ;
2425import io .reactivex .internal .functions .ObjectHelper ;
2526import io .reactivex .internal .util .NotificationLite ;
@@ -74,6 +75,7 @@ public final class ReplaySubject<T> extends Subject<T> {
7475 * the type of items observed and emitted by the Subject
7576 * @return the created subject
7677 */
78+ @ CheckReturnValue
7779 public static <T > ReplaySubject <T > create () {
7880 return new ReplaySubject <T >(new UnboundedReplayBuffer <T >(16 ));
7981 }
@@ -93,6 +95,7 @@ public static <T> ReplaySubject<T> create() {
9395 * the initial buffer capacity
9496 * @return the created subject
9597 */
98+ @ CheckReturnValue
9699 public static <T > ReplaySubject <T > create (int capacityHint ) {
97100 return new ReplaySubject <T >(new UnboundedReplayBuffer <T >(capacityHint ));
98101 }
@@ -117,6 +120,7 @@ public static <T> ReplaySubject<T> create(int capacityHint) {
117120 * the maximum number of buffered items
118121 * @return the created subject
119122 */
123+ @ CheckReturnValue
120124 public static <T > ReplaySubject <T > createWithSize (int maxSize ) {
121125 return new ReplaySubject <T >(new SizeBoundReplayBuffer <T >(maxSize ));
122126 }
@@ -170,6 +174,7 @@ public static <T> ReplaySubject<T> createWithSize(int maxSize) {
170174 * the {@link Scheduler} that provides the current time
171175 * @return the created subject
172176 */
177+ @ CheckReturnValue
173178 public static <T > ReplaySubject <T > createWithTime (long maxAge , TimeUnit unit , Scheduler scheduler ) {
174179 return new ReplaySubject <T >(new SizeAndTimeBoundReplayBuffer <T >(Integer .MAX_VALUE , maxAge , unit , scheduler ));
175180 }
@@ -208,6 +213,7 @@ public static <T> ReplaySubject<T> createWithTime(long maxAge, TimeUnit unit, Sc
208213 * the {@link Scheduler} that provides the current time
209214 * @return the created subject
210215 */
216+ @ CheckReturnValue
211217 public static <T > ReplaySubject <T > createWithTimeAndSize (long maxAge , TimeUnit unit , Scheduler scheduler , int maxSize ) {
212218 return new ReplaySubject <T >(new SizeAndTimeBoundReplayBuffer <T >(maxSize , maxAge , unit , scheduler ));
213219 }
0 commit comments