public class ReactiveAdapter
extends java.lang.Object
CompletableFuture
、RxJava Observable
などの非同期 / リアクティブ型との間の Reactive Streams Publisher
のアダプター。 アダプターは通常、ReactiveAdapterRegistry
を介して取得されます。
コンストラクターと説明 |
---|
ReactiveAdapter(ReactiveTypeDescriptor descriptor, java.util.function.Function<java.lang.Object,org.reactivestreams.Publisher<?>> toPublisherFunction, java.util.function.Function<org.reactivestreams.Publisher<?>,java.lang.Object> fromPublisherFunction) ターゲットのリアクティブ型または非同期型を Reactive Streams パブリッシャーとの間で変換する機能を持つアダプターのコンストラクター。 |
修飾子と型 | メソッドと説明 |
---|---|
java.lang.Object | fromPublisher(org.reactivestreams.Publisher<?> publisher) 指定された Reactive Streams パブリッシャーから適応します。 |
ReactiveTypeDescriptor | getDescriptor() アダプターのリアクティブ型の記述子を返します。 |
java.lang.Class<?> | getReactiveType() getDescriptor().getReactiveType() のショートカット。 |
boolean | isMultiValue() getDescriptor().isMultiValue() のショートカット。 |
boolean | isNoValue() getDescriptor().isNoValue() のショートカット。 |
boolean | supportsEmpty() getDescriptor().supportsEmpty() のショートカット。 |
<T> org.reactivestreams.Publisher<T> | toPublisher(java.lang.Object source) 指定されたインスタンスを Reactive Streams Publisher に適合させます。 |
public ReactiveAdapter(ReactiveTypeDescriptor descriptor, java.util.function.Function<java.lang.Object,org.reactivestreams.Publisher<?>> toPublisherFunction, java.util.function.Function<org.reactivestreams.Publisher<?>,java.lang.Object> fromPublisherFunction)
descriptor
- リアクティブ型記述子 toPublisherFunction
- パブリッシャーへのアダプター fromPublisherFunction
- パブリッシャーからのアダプター public ReactiveTypeDescriptor getDescriptor()
public java.lang.Class<?> getReactiveType()
getDescriptor().getReactiveType()
のショートカット。public boolean isMultiValue()
getDescriptor().isMultiValue()
のショートカット。public boolean supportsEmpty()
getDescriptor().supportsEmpty()
のショートカット。public boolean isNoValue()
getDescriptor().isNoValue()
のショートカット。public <T> org.reactivestreams.Publisher<T> toPublisher(@Nullable java.lang.Object source)
Publisher
に適合させます。source
- 適応するソースオブジェクト。指定されたオブジェクトが null
の場合、ReactiveTypeDescriptor.getEmptyValue()
が使用されます。public java.lang.Object fromPublisher(org.reactivestreams.Publisher<?> publisher)
publisher
- 適応するパブリッシャー