Package org.apache.groovy.runtime
Class MonadicCarrierRegistry
java.lang.Object
org.apache.groovy.runtime.MonadicCarrierRegistry
The standard carrier allow-list for monadic comprehensions: stdlib and
Groovy-core carriers whose bind/map method names diverge from the structural
flatMap/map convention.
Carriers known by Class (always on the classpath) are matched by
isInstance; carriers known only by name — third-party libraries
that Groovy must not depend on, such as Functional Java and Vavr — are
matched by walking the value's type hierarchy and comparing fully-qualified
names. The CompletionStage entry covers CompletableFuture;
the Awaitable entry covers DataflowVariable; the Functional
Java entries use that library's bind/map convention; the
Vavr entries use the structural flatMap/map convention.
- Since:
- 6.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOneClass-keyed allow-list row.static final classOne name-keyed allow-list row, for carriers Groovy must not depend on. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<MonadicCarrierRegistry.Entry>entries()TheClass-keyed allow-list, exposed for the type-checking extension.static String[]lookupBindMap(Object carrier) The[bind, map]method names for the given carrier value, ornullif it is not on either allow-list.The name-keyed allow-list, exposed for the type-checking extension.
-
Method Details
-
entries
TheClass-keyed allow-list, exposed for the type-checking extension. -
namedEntries
The name-keyed allow-list, exposed for the type-checking extension. -
lookupBindMap
The[bind, map]method names for the given carrier value, ornullif it is not on either allow-list.Classentries are tried first (isInstance), then name entries against the value's full type hierarchy (sofj.data.Somematchesfj.data.Option).
-