|
15 | 15 | */ |
16 | 16 | package org.springframework.data.repository.util; |
17 | 17 |
|
18 | | -import io.reactivex.Flowable; |
19 | | -import io.reactivex.Maybe; |
20 | 18 | import kotlinx.coroutines.flow.Flow; |
21 | 19 | import kotlinx.coroutines.flow.FlowKt; |
22 | 20 | import kotlinx.coroutines.reactive.ReactiveFlowKt; |
@@ -68,14 +66,6 @@ public abstract class ReactiveWrapperConverters { |
68 | 66 |
|
69 | 67 | static { |
70 | 68 |
|
71 | | - if (ReactiveWrappers.isAvailable(ReactiveLibrary.RXJAVA2)) { |
72 | | - |
73 | | - REACTIVE_WRAPPERS.add(RxJava2SingleWrapper.INSTANCE); |
74 | | - REACTIVE_WRAPPERS.add(RxJava2MaybeWrapper.INSTANCE); |
75 | | - REACTIVE_WRAPPERS.add(RxJava2ObservableWrapper.INSTANCE); |
76 | | - REACTIVE_WRAPPERS.add(RxJava2FlowableWrapper.INSTANCE); |
77 | | - } |
78 | | - |
79 | 69 | if (ReactiveWrappers.isAvailable(ReactiveLibrary.RXJAVA3)) { |
80 | 70 |
|
81 | 71 | REACTIVE_WRAPPERS.add(RxJava3SingleWrapper.INSTANCE); |
@@ -331,82 +321,6 @@ public Publisher<?> map(Object wrapper, Function<Object, Object> function) { |
331 | 321 | } |
332 | 322 | } |
333 | 323 |
|
334 | | - // ------------------------------------------------------------------------- |
335 | | - // RxJava 2 converters |
336 | | - // ------------------------------------------------------------------------- |
337 | | - |
338 | | - /** |
339 | | - * Wrapper for RxJava 2's {@link io.reactivex.Single}. |
340 | | - */ |
341 | | - private enum RxJava2SingleWrapper implements ReactiveTypeWrapper<io.reactivex.Single<?>> { |
342 | | - |
343 | | - INSTANCE; |
344 | | - |
345 | | - @Override |
346 | | - public Class<? super io.reactivex.Single<?>> getWrapperClass() { |
347 | | - return io.reactivex.Single.class; |
348 | | - } |
349 | | - |
350 | | - @Override |
351 | | - public io.reactivex.Single<?> map(Object wrapper, Function<Object, Object> function) { |
352 | | - return ((io.reactivex.Single<?>) wrapper).map(function::apply); |
353 | | - } |
354 | | - } |
355 | | - |
356 | | - /** |
357 | | - * Wrapper for RxJava 2's {@link io.reactivex.Maybe}. |
358 | | - */ |
359 | | - private enum RxJava2MaybeWrapper implements ReactiveTypeWrapper<Maybe<?>> { |
360 | | - |
361 | | - INSTANCE; |
362 | | - |
363 | | - @Override |
364 | | - public Class<? super io.reactivex.Maybe<?>> getWrapperClass() { |
365 | | - return io.reactivex.Maybe.class; |
366 | | - } |
367 | | - |
368 | | - @Override |
369 | | - public io.reactivex.Maybe<?> map(Object wrapper, Function<Object, Object> function) { |
370 | | - return ((io.reactivex.Maybe<?>) wrapper).map(function::apply); |
371 | | - } |
372 | | - } |
373 | | - |
374 | | - /** |
375 | | - * Wrapper for RxJava 2's {@link io.reactivex.Observable}. |
376 | | - */ |
377 | | - private enum RxJava2ObservableWrapper implements ReactiveTypeWrapper<io.reactivex.Observable<?>> { |
378 | | - |
379 | | - INSTANCE; |
380 | | - |
381 | | - @Override |
382 | | - public Class<? super io.reactivex.Observable<?>> getWrapperClass() { |
383 | | - return io.reactivex.Observable.class; |
384 | | - } |
385 | | - |
386 | | - @Override |
387 | | - public io.reactivex.Observable<?> map(Object wrapper, Function<Object, Object> function) { |
388 | | - return ((io.reactivex.Observable<?>) wrapper).map(function::apply); |
389 | | - } |
390 | | - } |
391 | | - |
392 | | - /** |
393 | | - * Wrapper for RxJava 2's {@link io.reactivex.Flowable}. |
394 | | - */ |
395 | | - private enum RxJava2FlowableWrapper implements ReactiveTypeWrapper<Flowable<?>> { |
396 | | - |
397 | | - INSTANCE; |
398 | | - |
399 | | - @Override |
400 | | - public Class<? super Flowable<?>> getWrapperClass() { |
401 | | - return io.reactivex.Flowable.class; |
402 | | - } |
403 | | - |
404 | | - @Override |
405 | | - public io.reactivex.Flowable<?> map(Object wrapper, Function<Object, Object> function) { |
406 | | - return ((io.reactivex.Flowable<?>) wrapper).map(function::apply); |
407 | | - } |
408 | | - } |
409 | | - |
410 | 324 | // ------------------------------------------------------------------------- |
411 | 325 | // RxJava 3 converters |
412 | 326 | // ------------------------------------------------------------------------- |
|
0 commit comments