Class TypeSubstitutions
java.lang.Object
net.covers1624.coffeegrinder.type.TypeSubstitutions
Helpers for applying type substitutions.
Created by covers1624 on 2/5/22.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldapplyOwnerParameterization(ParameterizedClass owner, Field field) Parameterize the given field.static MethodapplyOwnerParameterization(ParameterizedClass owner, Method method) static Methodparameterize(ClassType owner, Method method, TypeSubstitutions.TypeParamMapper mapper) Parameterize the given method.static ATypesubst(AType type, TypeSubstitutions.TypeMapper mapper) Apply the substitutions given by the provided mapper recursively.static ClassTypesubst(ClassType type, TypeSubstitutions.TypeMapper mapper) Apply the substitutions given by the provided mapper recursively.static ReferenceTypesubst(ReferenceType type, TypeSubstitutions.TypeMapper mapper) Apply the substitutions given by the provided mapper recursively.
-
Constructor Details
-
TypeSubstitutions
public TypeSubstitutions()
-
-
Method Details
-
subst
Apply the substitutions given by the provided mapper recursively.- Parameters:
type- The input type.mapper- TheTypeSubstitutions.TypeMapper.- Returns:
- The substituted type.
-
subst
Apply the substitutions given by the provided mapper recursively.- Parameters:
type- The input type.mapper- TheTypeSubstitutions.TypeMapper.- Returns:
- The substituted type.
-
subst
Apply the substitutions given by the provided mapper recursively.- Parameters:
type- The input type.mapper- TheTypeSubstitutions.TypeMapper.- Returns:
- The substituted type.
-
applyOwnerParameterization
Parameterize the given field.- Parameters:
owner- The owner of the field. (where it is declared)field- The field to parameterize.- Returns:
- The parameterized field. May return the same field passed in if no substitutions were made.
-
applyOwnerParameterization
-
parameterize
public static Method parameterize(ClassType owner, Method method, TypeSubstitutions.TypeParamMapper mapper) Parameterize the given method.- Parameters:
owner- The owner of the method. (where it is declared)method- The method to parameterize.mapper- TheTypeSubstitutions.TypeMapperto apply.- Returns:
- The parameterized method.
-