Top Description Inners Fields Methods
reactor.core

public Interface Scannable

Known Direct Subinterfaces
reactor.core.publisher.SignalPeek, reactor.core.publisher.InnerProducer, reactor.core.publisher.Sinks.Many, reactor.core.publisher.Sinks.Empty, reactor.core.publisher.SourceProducer, reactor.core.publisher.InnerConsumer
Known Direct Implementers
reactor.core.publisher.BlockingIterable, reactor.core.publisher.ConnectableFluxHide, reactor.core.publisher.ConnectableFluxOnAssembly, reactor.core.publisher.ConnectableLift, reactor.core.publisher.ConnectableLiftFuseable, reactor.core.publisher.MonoDelay, reactor.core.publisher.MonoDelayUntil, reactor.core.publisher.MonoFromFluxOperator, reactor.core.publisher.MonoFromPublisher, reactor.core.publisher.NextProcessor, reactor.core.publisher.Operators.CancelledSubscription, reactor.core.publisher.Operators.EmptySubscription, reactor.core.publisher.Operators.DeferredSubscription, reactor.core.publisher.ParallelCollect, reactor.core.publisher.ParallelConcatMap, reactor.core.publisher.ParallelDoOnEach, reactor.core.publisher.ParallelFilter, reactor.core.publisher.ParallelFlatMap, reactor.core.publisher.ParallelFluxHide, reactor.core.publisher.ParallelFluxName, reactor.core.publisher.ParallelFluxOnAssembly, reactor.core.publisher.ParallelFluxRestoringThreadLocals, reactor.core.publisher.ParallelGroup, reactor.core.publisher.ParallelLift, reactor.core.publisher.ParallelLiftFuseable, reactor.core.publisher.ParallelLog, reactor.core.publisher.ParallelMap, reactor.core.publisher.FluxOperator, reactor.core.publisher.FluxProcessor, reactor.core.publisher.FluxPublish, reactor.core.publisher.FluxFromMonoOperator, reactor.core.publisher.FluxSubscribeOnCallable, reactor.core.publisher.MonoCurrentContext, reactor.core.publisher.ParallelMergeOrdered, reactor.core.publisher.SinkManyBestEffort, reactor.core.publisher.FluxCreate.SerializedFluxSink, reactor.core.publisher.FluxCreate.SerializeOnRequestSink, reactor.core.publisher.FluxFirstWithSignal.RaceCoordinator, reactor.core.publisher.FluxFirstWithValue.RaceValuesCoordinator, reactor.core.publisher.FluxSubscribeOnValue, reactor.core.publisher.MonoOperator, reactor.core.publisher.MonoProcessor, reactor.core.publisher.ParallelMergeReduce, reactor.core.publisher.ParallelMergeSequential, reactor.core.publisher.ParallelMergeSort, reactor.core.publisher.ParallelReduceSeed, reactor.core.publisher.ParallelRunOn, reactor.core.publisher.ParallelSource, reactor.core.publisher.ParallelThen, reactor.core.publisher.InternalConnectableFluxOperator, reactor.core.publisher.InternalFluxOperator, reactor.core.publisher.InternalMonoOperator, reactor.core.publisher.MonoCompletionStage, reactor.core.publisher.FluxAutoConnect, reactor.core.publisher.FluxAutoConnectFuseable, reactor.core.publisher.MonoIgnorePublisher, reactor.core.publisher.MonoIgnoreThen, reactor.core.publisher.FluxRefCount, reactor.core.publisher.FluxRefCountGrace, reactor.core.publisher.FluxReplay, reactor.core.publisher.MonoSource, reactor.core.publisher.MonoSourceFuseable, reactor.core.publisher.MonoSubscribeOnCallable, reactor.core.publisher.MonoSubscribeOnValue, reactor.core.publisher.SinkManyEmitterProcessor, reactor.core.publisher.SinkManyReplayProcessor, reactor.core.publisher.SinkManySerialized, reactor.core.publisher.StrictSubscriber, reactor.core.publisher.GroupedLift, reactor.core.publisher.GroupedLiftFuseable, reactor.core.scheduler.BoundedElasticScheduler, reactor.core.scheduler.BoundedElasticScheduler.BoundedState, reactor.core.scheduler.BoundedElasticScheduler.BoundedScheduledExecutorService, reactor.core.scheduler.DelegateServiceScheduler, reactor.core.scheduler.ExecutorScheduler, reactor.core.scheduler.ExecutorScheduler.ExecutorSchedulerWorker, reactor.core.scheduler.ExecutorScheduler.ExecutorSchedulerTrampolineWorker, reactor.core.scheduler.ExecutorServiceWorker, reactor.core.scheduler.ImmediateScheduler, reactor.core.scheduler.ImmediateScheduler.ImmediateSchedulerWorker, reactor.core.scheduler.ParallelScheduler, reactor.core.scheduler.Schedulers.CachedScheduler, reactor.core.scheduler.SingleScheduler, reactor.core.scheduler.SingleWorkerScheduler, reactor.core.scheduler.ThreadPerTaskBoundedElasticScheduler, reactor.adapter.JdkFlowAdapter.FlowPublisherAsFlux, reactor.core.Disposables.ListCompositeDisposable
Annotations
@FunctionalInterface
Imports
java.util.ArrayList, .Collections, .Iterator, .LinkedHashMap, .LinkedList, .List, .Map, .Objects, .Spliterators, java.util.function.Function, java.util.regex.Pattern, java.util.stream.Collectors, .Stream, .StreamSupport, org.reactivestreams.Subscriber, reactor.core.scheduler.Scheduler, .Scheduler.Worker, reactor.util.annotation.Nullable, reactor.util.function.Tuple2

A Scannable component exposes state in a non strictly memory consistent way and results should be understood as best-effort hint of the underlying state. This is useful to retro-engineer a component graph such as a flux operator chain via Stream queries from actuals(), parents() and inners(). This allows for visiting patterns and possibly enable serviceability features.

Scannable is also a useful tool for the advanced user eager to learn which kind of state we usually manage in the package-scope schedulers or operators implementations.

Author
Stephane Maldini

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Scannable.Attr<
the type of data associated with an attribute
T
>

Base class for Scannable attributes, which all can define a meaningful default.

Field Summary

Modifier and TypeField and Description
public static final Pattern
OPERATOR_NAME_UNRELATED_WORDS_PATTERN

The pattern for matching words unrelated to operator name.

Method Summary

Modifier and TypeMethod and Description
public default Stream<? extends Scannable>

Returns:

a Stream navigating the org.reactivestreams.Subscriber chain (downward, current Scannable not included).
actuals
()

Return a Stream navigating the org.reactivestreams.Subscriber chain (downward).

public static Scannable

Returns:

the casted Scannable, or one of two default Scannable instances that aren't actually scannable (one for nulls, one for non-scannable references)
from
(Object
a reference to cast
o
)

Attempt to cast the Object to a Scannable.

public default Stream<? extends Scannable>

Returns:

a Stream of referenced inners (flatmap, multicast etc)
inners
()

Return a Stream of referenced inners (flatmap, multicast etc)

public default boolean

Returns:

true whether the component is available for scan(Attr) resolution.
isScanAvailable
()

Return true whether the component is available for scan(Attr) resolution.

public default String

Returns:

the name of the first parent that has one defined (including this scannable)
name
()

Check this Scannable and its parents() for a user-defined name and return the first one that is reachable, or default to this Scannable stepName() if none.

public default Stream<? extends Scannable>

Returns:

a Stream navigating the org.reactivestreams.Subscription chain (upward, current Scannable not included).
parents
()

Return a Stream navigating the org.reactivestreams.Subscription chain (upward).

public default <T> T

Returns:

a value associated to the key or null if unmatched or unresolved
scan
(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Introspect a component's specific state attribute, returning an associated value specific to that component, or the default value associated with the key, or null if the attribute doesn't make sense for that particular component and has no sensible default.

public default <T> T

Returns:

a value associated to the key or the provided default if unmatched or unresolved
scanOrDefault
(Scannable.Attr<T>
a Attr to resolve for the component.
key
,
T
a fallback value if key resolve to null
defaultValue
)

Introspect a component's specific state attribute.

public Object

Returns:

the value associated to the key for that specific component, or null if none.
scanUnsafe
(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

This method is used internally by components to define their key-value mappings in a single place.

public default String
stepName()

Return a meaningful String representation of this Scannable in its chain of parents() and actuals().

public default Stream<String>

Returns:

a Stream of stepName() for each discovered step in the Scannable chain
steps
()

List the step names in the chain of Scannable (including the current element), in their assembly order.

public default Stream<Tuple2<String, String>>

Returns:

the stream of tags for this Scannable and its reachable parents, including duplicates
tags
()

Visit this Scannable and its parents(), starting by the furthest reachable parent, and return a Stream of the tags which includes duplicates and outputs tags in declaration order (grandparent tag(s) > parent tag(s) > current tag(s)).

public default Map<String, String>

Returns:

a Map of deduplicated tags from this Scannable and its reachable parents
tagsDeduplicated
()

Visit this Scannable and its parents(), starting by the furthest reachable parent, deduplicate tags that have a common key by favoring the value declared last (current tag(s) > parent tag(s) > grandparent tag(s)) and return a Map of the deduplicated tags.

Field Detail

OPERATOR_NAME_UNRELATED_WORDS_PATTERNback to summary
public static final Pattern OPERATOR_NAME_UNRELATED_WORDS_PATTERN

The pattern for matching words unrelated to operator name. Used to strip an operator name of various prefixes and suffixes.

Method Detail

actualsback to summary
public default Stream<? extends Scannable> actuals()

Return a Stream navigating the org.reactivestreams.Subscriber chain (downward). The current Scannable is not included.

Returns:Stream<? extends Scannable>

a Stream navigating the org.reactivestreams.Subscriber chain (downward, current Scannable not included).

fromback to summary
public static Scannable from(Object o)

Attempt to cast the Object to a Scannable. Return Attr#NULL_SCAN if the value is null, or Attr#UNAVAILABLE_SCAN if the value is not a Scannable. Both are constant Scannable that return false on Scannable#isScanAvailable.

Parameters
o:Object

a reference to cast

Returns:Scannable

the casted Scannable, or one of two default Scannable instances that aren't actually scannable (one for nulls, one for non-scannable references)

innersback to summary
public default Stream<? extends Scannable> inners()

Return a Stream of referenced inners (flatmap, multicast etc)

Returns:Stream<? extends Scannable>

a Stream of referenced inners (flatmap, multicast etc)

isScanAvailableback to summary
public default boolean isScanAvailable()

Return true whether the component is available for scan(Attr) resolution.

Returns:boolean

true whether the component is available for scan(Attr) resolution.

nameback to summary
public default String name()

Check this Scannable and its parents() for a user-defined name and return the first one that is reachable, or default to this Scannable stepName() if none.

Returns:String

the name of the first parent that has one defined (including this scannable)

parentsback to summary
public default Stream<? extends Scannable> parents()

Return a Stream navigating the org.reactivestreams.Subscription chain (upward). The current Scannable is not included.

Returns:Stream<? extends Scannable>

a Stream navigating the org.reactivestreams.Subscription chain (upward, current Scannable not included).

scanback to summary
public default <T> T scan(Scannable.Attr<T> key)

Introspect a component's specific state attribute, returning an associated value specific to that component, or the default value associated with the key, or null if the attribute doesn't make sense for that particular component and has no sensible default.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:T

a value associated to the key or null if unmatched or unresolved

Annotations
@Nullable
scanOrDefaultback to summary
public default <T> T scanOrDefault(Scannable.Attr<T> key, T defaultValue)

Introspect a component's specific state attribute. If there's no specific value in the component for that key, fall back to returning the provided non null default.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

defaultValue:T

a fallback value if key resolve to null

Returns:T

a value associated to the key or the provided default if unmatched or unresolved

scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the Attr key, implementors should take care to return values of the correct type, and return null if no specific value is available.

For public consumption of attributes, prefer using scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Nullable
stepNameback to summary
public default String stepName()

Return a meaningful String representation of this Scannable in its chain of parents() and actuals().

stepsback to summary
public default Stream<String> steps()

List the step names in the chain of Scannable (including the current element), in their assembly order. This traverses the chain of Scannable both upstream (parents()) and downstream (actuals()).

  1. if the current Scannable is a Subscriber, the chain can reach down to the final subscriber, provided it is Scannable (eg. lambda subscriber)
  2. if it is an operator the chain can reach up to the source, if it is a Reactor source (that is Scannable).
Returns:Stream<String>

a Stream of stepName() for each discovered step in the Scannable chain

tagsback to summary
public default Stream<Tuple2<String, String>> tags()

Visit this Scannable and its parents(), starting by the furthest reachable parent, and return a Stream of the tags which includes duplicates and outputs tags in declaration order (grandparent tag(s) > parent tag(s) > current tag(s)).

Tags can only be discovered until no parent can be inspected, which happens either when the source publisher has been reached or when a non-reactor intermediate operator is present in the parent chain (i.e. a stage that is not Scannable for Attr#PARENT).

Returns:Stream<Tuple2<String, String>>

the stream of tags for this Scannable and its reachable parents, including duplicates

See Also
tagsDeduplicated()
tagsDeduplicatedback to summary
public default Map<String, String> tagsDeduplicated()

Visit this Scannable and its parents(), starting by the furthest reachable parent, deduplicate tags that have a common key by favoring the value declared last (current tag(s) > parent tag(s) > grandparent tag(s)) and return a Map of the deduplicated tags. Note that while the values are the "latest", the key iteration order reflects the tags' declaration order.

Tags can only be discovered until no parent can be inspected, which happens either when the source publisher has been reached or when a non-reactor intermediate operator is present in the parent chain (i.e. a stage that is not Scannable for Attr#PARENT).

Returns:Map<String, String>

a Map of deduplicated tags from this Scannable and its reachable parents

See Also
tags()
reactor.core back to summary

public Class Scannable.Attr<T>

extends Object
Class Inheritance
Known Direct Subclasses
reactor.core.publisher.InternalProducerAttr
Type Parameters
<T>
the type of data associated with an attribute

Base class for Scannable attributes, which all can define a meaningful default.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Scannable.Attr.RunStyle

An Enum enumerating the different styles an operator can run : their ordinal() reflects the level of confidence in their running mode

Field Summary

Modifier and TypeField and Description
public static final Scannable.Attr<Scannable>
ACTUAL

The direct dependent component downstream reference if any.

public static final Scannable.Attr<Boolean>
ACTUAL_METADATA

Indicate that for some purposes a Scannable should be used as additional source of information about a contiguous Scannable in the chain.

public static final Scannable.Attr<Integer>
BUFFERED

A Integer attribute implemented by components with a backlog capacity.

public static final Scannable.Attr<Boolean>
CANCELLED

A Boolean attribute indicating whether or not a downstream component has interrupted consuming this scanned component, e.g., a cancelled subscription.

public static final Scannable.Attr<Integer>
CAPACITY

Return an an Integer capacity when no PREFETCH is defined or when an arbitrary maximum limit is applied to the backlog capacity of the scanned component.

pack-priv final T
public static final Scannable.Attr<Boolean>
DELAY_ERROR

Delay_Error exposes a Boolean whether the scanned component actively supports error delaying if it manages a backlog instead of fast error-passing which might drop pending backlog.

public static final Scannable.Attr<Throwable>
ERROR

a Throwable attribute which indicate an error state if the scanned component keeps track of it.

public static final Scannable.Attr<Long>
LARGE_BUFFERED

Similar to Attr#BUFFERED, but reserved for operators that can hold a backlog of items that can grow beyond Integer.MAX_VALUE.

public static final Scannable.Attr<String>
LIFTER

LIFTER attribute exposes name of the lifter function.

public static final Scannable.Attr<String>
NAME

An arbitrary name given to the operator component.

pack-priv static final Scannable
NULL_SCAN

A constant that represents Scannable returned via from(Object) when the passed reference is null

public static final Scannable.Attr<Scannable>
PARENT

Parent key exposes the direct upstream relationship of the scanned component.

public static final Scannable.Attr<Integer>
PREFETCH

Prefetch is an Integer attribute defining the rate of processing in a component which has capacity to request and hold a backlog of data.

public static final Scannable.Attr<Long>
REQUESTED_FROM_DOWNSTREAM

A Long attribute exposing the current pending demand of a downstream component.

public static final Scannable.Attr<Scannable>
RUN_ON

A key that links a Scannable to another Scannable it runs on.

public static final Scannable.Attr<Scannable.Attr.RunStyle>
RUN_STYLE

An RunStyle enum attribute indicating whether or not an operator continues to operate on the same thread.

pack-priv final Function<Object, ? extends T>
public static final Scannable.Attr<Stream<Tuple2<String, String>>>
TAGS

A Stream of reactor.util.function.Tuple2 representing key/value pairs for tagged components.

public static final Scannable.Attr<Boolean>
TERMINATED

A Boolean attribute indicating whether or not an upstream component terminated this scanned component.

pack-priv static final Scannable
UNAVAILABLE_SCAN

A constant that represents Scannable returned via from(Object) when the passed non-null reference is not a Scannable

Constructor Summary

AccessConstructor and Description
protected
Attr(T defaultValue)

protected
Attr(T defaultValue, Function<Object, ? extends T> safeConverter)

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the default value applicable to all components or null if none.
defaultValue
()

Meaningful and always applicable default value for the attribute, returned instead of null when a specific value hasn't been defined for a component.

pack-priv boolean

Returns:

true if the attribute can safely convert any object, false if it can throw ClassCastException
isConversionSafe
()

Checks if this attribute is capable of safely converting any Object into a T via tryConvert(Object) (potentially returning null or a Null Object for incompatible raw values).

pack-priv static Stream<? extends Scannable>
pack-priv T

Returns:

the converted instance
tryConvert
(Object
the instance to attempt conversion on
o
)

Attempt to convert any Object instance o into a T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACTUALback to summary
public static final Scannable.Attr<Scannable> ACTUAL

The direct dependent component downstream reference if any. Operators in Flux/Mono for instance delegate to a target Subscriber, which is going to be the actual chain navigated with this reference key. Subscribers are not always Scannable, but this attribute will convert these raw results to an unavailable scan object in this case.

A reference chain downstream can be navigated via Scannable#actuals().

ACTUAL_METADATAback to summary
public static final Scannable.Attr<Boolean> ACTUAL_METADATA

Indicate that for some purposes a Scannable should be used as additional source of information about a contiguous Scannable in the chain.

For example Scannable#steps() uses this to collate the stepName of an assembly trace to its wrapped operator (the one before it in the assembly chain).

BUFFEREDback to summary
public static final Scannable.Attr<Integer> BUFFERED

A Integer attribute implemented by components with a backlog capacity. It will expose current queue size or similar related to user-provided held data. Note that some operators and processors CAN keep a backlog larger than Integer.MAX_VALUE, in which case the Attr LARGE_BUFFERED should be used instead. Such operators will attempt to serve a BUFFERED query but will return Integer#MIN_VALUE when actual buffer size is oversized for int.

CANCELLEDback to summary
public static final Scannable.Attr<Boolean> CANCELLED

A Boolean attribute indicating whether or not a downstream component has interrupted consuming this scanned component, e.g., a cancelled subscription. Note that it differs from TERMINATED which is intended for "normal" shutdown cycles.

CAPACITYback to summary
public static final Scannable.Attr<Integer> CAPACITY

Return an an Integer capacity when no PREFETCH is defined or when an arbitrary maximum limit is applied to the backlog capacity of the scanned component. Integer#MAX_VALUE signal unlimited capacity.

Note

This attribute usually resolves to a constant value.

defaultValueback to summary
pack-priv final T defaultValue
DELAY_ERRORback to summary
public static final Scannable.Attr<Boolean> DELAY_ERROR

Delay_Error exposes a Boolean whether the scanned component actively supports error delaying if it manages a backlog instead of fast error-passing which might drop pending backlog.

Note

This attribute usually resolves to a constant value.

ERRORback to summary
public static final Scannable.Attr<Throwable> ERROR

a Throwable attribute which indicate an error state if the scanned component keeps track of it.

LARGE_BUFFEREDback to summary
public static final Scannable.Attr<Long> LARGE_BUFFERED

Similar to Attr#BUFFERED, but reserved for operators that can hold a backlog of items that can grow beyond Integer.MAX_VALUE. These operators will also answer to a Attr#BUFFERED query up to the point where their buffer is actually too large, at which point they'll return Integer.MIN_VALUE, which serves as a signal that this attribute should be used instead. Defaults to null.

Flux.flatMap, Flux.filterWhen and Flux.window (with overlap) are known to use this attribute.

LIFTERback to summary
public static final Scannable.Attr<String> LIFTER

LIFTER attribute exposes name of the lifter function. It is calculated as Object#toString of a function passed to the reactor.core.publisher.Operators#lift or reactor.core.publisher.Operators#liftPublisher. Defaults to null.

NAMEback to summary
public static final Scannable.Attr<String> NAME

An arbitrary name given to the operator component. Defaults to null.

NULL_SCANback to summary
pack-priv static final Scannable NULL_SCAN

A constant that represents Scannable returned via from(Object) when the passed reference is null

PARENTback to summary
public static final Scannable.Attr<Scannable> PARENT

Parent key exposes the direct upstream relationship of the scanned component. It can be a Publisher source to an operator, a Subscription to a Subscriber (main flow if ambiguous with inner Subscriptions like flatMap), a Scheduler to a Worker. These types are not always Scannable, but this attribute will convert such raw results to an unavailable scan object in this case.

Scannable#parents() can be used to navigate the parent chain.

PREFETCHback to summary
public static final Scannable.Attr<Integer> PREFETCH

Prefetch is an Integer attribute defining the rate of processing in a component which has capacity to request and hold a backlog of data. It usually maps to a component capacity when no arbitrary CAPACITY is set. Integer#MAX_VALUE signal unlimited capacity and therefore unbounded demand.

Note

This attribute usually resolves to a constant value.

REQUESTED_FROM_DOWNSTREAMback to summary
public static final Scannable.Attr<Long> REQUESTED_FROM_DOWNSTREAM

A Long attribute exposing the current pending demand of a downstream component. Note that Long#MAX_VALUE indicates an unbounded (push-style) demand as specified in org.reactivestreams.Subscription#request(long).

RUN_ONback to summary
public static final Scannable.Attr<Scannable> RUN_ON

A key that links a Scannable to another Scannable it runs on. Usually exposes a link between an operator/subscriber and its Worker or Scheduler, provided these are Scannable. Will return Attr#UNAVAILABLE_SCAN if the supporting execution is not Scannable or Attr#NULL_SCAN if the operator doesn't define a specific runtime.

RUN_STYLEback to summary
public static final Scannable.Attr<Scannable.Attr.RunStyle> RUN_STYLE

An RunStyle enum attribute indicating whether or not an operator continues to operate on the same thread. Each value provides a different degree of guarantee from weakest RunStyle#UNKNOWN to strongest RunStyle#SYNC. Defaults to RunStyle#UNKNOWN.

safeConverterback to summary
pack-priv final Function<Object, ? extends T> safeConverter
TAGSback to summary
public static final Scannable.Attr<Stream<Tuple2<String, String>>> TAGS

A Stream of reactor.util.function.Tuple2 representing key/value pairs for tagged components. Defaults to null.

TERMINATEDback to summary
public static final Scannable.Attr<Boolean> TERMINATED

A Boolean attribute indicating whether or not an upstream component terminated this scanned component. e.g. a post onComplete/onError subscriber. By opposition to CANCELLED which determines if a downstream component interrupted this scanned component.

UNAVAILABLE_SCANback to summary
pack-priv static final Scannable UNAVAILABLE_SCAN

A constant that represents Scannable returned via from(Object) when the passed non-null reference is not a Scannable

Constructor Detail

Attrback to summary
protected Attr(T defaultValue)
Attrback to summary
protected Attr(T defaultValue, Function<Object, ? extends T> safeConverter)

Method Detail

defaultValueback to summary
public T defaultValue()

Meaningful and always applicable default value for the attribute, returned instead of null when a specific value hasn't been defined for a component. null if no sensible generic default is available.

Returns:T

the default value applicable to all components or null if none.

Annotations
@Nullable
isConversionSafeback to summary
pack-priv boolean isConversionSafe()

Checks if this attribute is capable of safely converting any Object into a T via tryConvert(Object) (potentially returning null or a Null Object for incompatible raw values).

Returns:boolean

true if the attribute can safely convert any object, false if it can throw ClassCastException

recurseback to summary
pack-priv static Stream<? extends Scannable> recurse(Scannable _s, Scannable.Attr<Scannable> key)
tryConvertback to summary
pack-priv T tryConvert(Object o)

Attempt to convert any Object instance o into a T. By default unsafe attributes will just try forcing a cast, which can lead to ClassCastException. However, attributes for which isConversionSafe() returns true are required to not throw an exception (but rather return null or a Null Object).

Parameters
o:Object

the instance to attempt conversion on

Returns:T

the converted instance

Annotations
@Nullable
reactor.core back to summary

public final Enum Scannable.Attr.RunStyle

extends Enum<Scannable.Attr.RunStyle>
Class Inheritance

An Enum enumerating the different styles an operator can run : their ordinal() reflects the level of confidence in their running mode

Field Summary

Modifier and TypeField and Description
public static final Scannable.Attr.RunStyle
ASYNC

the operator may change threads while running

public static final Scannable.Attr.RunStyle
SYNC

guarantees the operator doesn't change threads (strongest level of guarantee)

public static final Scannable.Attr.RunStyle
UNKNOWN

no guarantees can be given on the running mode (default value, weakest level of guarantee)

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Scannable.Attr.RunStyle
public static Scannable.Attr.RunStyle[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ASYNCback to summary
public static final Scannable.Attr.RunStyle ASYNC

the operator may change threads while running

SYNCback to summary
public static final Scannable.Attr.RunStyle SYNC

guarantees the operator doesn't change threads (strongest level of guarantee)

UNKNOWNback to summary
public static final Scannable.Attr.RunStyle UNKNOWN

no guarantees can be given on the running mode (default value, weakest level of guarantee)

Constructor Detail

RunStyleback to summary
private RunStyle()

Method Detail

valueOfback to summary
public static Scannable.Attr.RunStyle valueOf(String name)
valuesback to summary
public static Scannable.Attr.RunStyle[] values()