Class TypeVariableBinder
java.lang.Object
io.micronaut.inject.ast.TypeVariableBinder
Binds the type variables a super type leaves in the arguments it reports for the types above it, for
ClassElement.getAllTypeArguments() and the language implementations that walk their super types
themselves.- Since:
- 5.2.2
- Author:
- Micronaut
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull Map<String, ClassElement> bind(@NonNull Map<String, ClassElement> typeArguments, @NonNull Map<String, ClassElement> bindings) Replaces the type variables named in the bindings, all at once, so a variable a binding introduces is never replaced again:[K, V]bound with{K=V, V=K}gives[V, K].
-
Method Details
-
bind
@NonNull public static @NonNull Map<String, ClassElement> bind(@NonNull @NonNull Map<String, ClassElement> typeArguments, @NonNull @NonNull Map<String, ClassElement> bindings) Replaces the type variables named in the bindings, all at once, so a variable a binding introduces is never replaced again:[K, V]bound with{K=V, V=K}gives[V, K].The arguments passed in must be the ones the type declares, written in its own variables, not ones a caller resolved already: a resolved argument bound a second time is replaced again, and swaps back whenever the variable names of the two types collide.
- Parameters:
typeArguments- The type arguments to bindbindings- The types bound to the variables, by variable name- Returns:
- The bound type arguments, the same map if no variable was bound
-