类 ReactiveTypeDescriptor
java.lang.Object
cn.taketoday.core.ReactiveTypeDescriptor
Describes the semantics of a reactive type including boolean checks for
isMultiValue(), isNoValue(), and supportsEmpty().- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Harry Yang
-
字段概要
字段 -
构造器概要
构造器限定符构造器说明privateReactiveTypeDescriptor(Class<?> reactiveType, boolean multiValue, boolean noValue, Supplier<?> emptySupplier) privateReactiveTypeDescriptor(Class<?> reactiveType, boolean multiValue, boolean noValue, Supplier<?> emptySupplier, boolean deferred) -
方法概要
修饰符和类型方法说明booleanReturn an empty-value instance for the underlying reactive or async type.Class<?>Return the reactive type for this descriptor.inthashCode()booleanWhether the underlying operation is deferred and needs to be started explicitly, e.g. via subscribing (or similar), or whether it is triggered without the consumer having any control.booleanReturntrueif the reactive type can produce more than 1 value can be produced and is therefore a good fit to adapt toFlux.booleanReturntrueif the reactive type does not produce any values and only provides completion and error signals.static ReactiveTypeDescriptormultiValue(Class<?> type, Supplier<?> emptySupplier) Descriptor for a reactive type that can produce 0..N values.static ReactiveTypeDescriptornonDeferredAsyncValue(Class<?> type, Supplier<?> emptySupplier) The same assingleOptionalValue(Class, Supplier)but for a non-deferred, async type such asCompletableFuture.static ReactiveTypeDescriptorDescriptor for a reactive type that does not produce any values.static ReactiveTypeDescriptorsingleOptionalValue(Class<?> type, Supplier<?> emptySupplier) Descriptor for a reactive type that can produce 0..1 values.static ReactiveTypeDescriptorsingleRequiredValue(Class<?> type) Descriptor for a reactive type that must produce 1 value to complete.booleanReturntrueif the reactive type can complete with no values.
-
字段详细资料
-
reactiveType
-
multiValue
private final boolean multiValue -
noValue
private final boolean noValue -
emptySupplier
-
deferred
private final boolean deferred
-
-
构造器详细资料
-
ReactiveTypeDescriptor
-
ReactiveTypeDescriptor
-
-
方法详细资料
-
getReactiveType
Return the reactive type for this descriptor. -
isMultiValue
public boolean isMultiValue()Returntrueif the reactive type can produce more than 1 value can be produced and is therefore a good fit to adapt toFlux. Afalsereturn value implies the reactive type can produce 1 value at most and is therefore a good fit to adapt toMono. -
isNoValue
public boolean isNoValue()Returntrueif the reactive type does not produce any values and only provides completion and error signals. -
supportsEmpty
public boolean supportsEmpty()Returntrueif the reactive type can complete with no values. -
getEmptyValue
Return an empty-value instance for the underlying reactive or async type.Use of this type implies
supportsEmpty()istrue. -
isDeferred
public boolean isDeferred()Whether the underlying operation is deferred and needs to be started explicitly, e.g. via subscribing (or similar), or whether it is triggered without the consumer having any control. -
equals
-
hashCode
public int hashCode() -
multiValue
Descriptor for a reactive type that can produce 0..N values.- 参数:
type- the reactive typeemptySupplier- a supplier of an empty-value instance of the reactive type
-
singleOptionalValue
Descriptor for a reactive type that can produce 0..1 values.- 参数:
type- the reactive typeemptySupplier- a supplier of an empty-value instance of the reactive type
-
singleRequiredValue
Descriptor for a reactive type that must produce 1 value to complete.- 参数:
type- the reactive type
-
noValue
Descriptor for a reactive type that does not produce any values.- 参数:
type- the reactive typeemptySupplier- a supplier of an empty-value instance of the reactive type
-
nonDeferredAsyncValue
public static ReactiveTypeDescriptor nonDeferredAsyncValue(Class<?> type, Supplier<?> emptySupplier) The same assingleOptionalValue(Class, Supplier)but for a non-deferred, async type such asCompletableFuture.- 参数:
type- the reactive typeemptySupplier- a supplier of an empty-value instance of the reactive type
-