public class TypeArguments extends Object
| Modifier and Type | Field and Description |
|---|---|
static AttributeKey<TypeParamRef> |
ORIGINAL_TYPE_PARAMETER |
| Constructor and Description |
|---|
TypeArguments() |
| Modifier and Type | Method and Description |
|---|---|
static RichTypeDef |
apply(ClassRef classRef) |
static RichTypeDef |
apply(TypeDef definition) |
static Map<String,TypeRef> |
getGenericArgumentsMappings(ClassRef ref)
Given a reference to a generic class, determine a mapping between generic arguments definitions and instantiations.
|
static Map<String,TypeRef> |
getGenericArgumentsMappings(ClassRef ref,
TypeDef definition)
Given a reference to a generic class, determine a mapping between generic arguments definitions and instantiations.
|
public static final AttributeKey<TypeParamRef> ORIGINAL_TYPE_PARAMETER
public static RichTypeDef apply(ClassRef classRef)
public static RichTypeDef apply(TypeDef definition)
public static Map<String,TypeRef> getGenericArgumentsMappings(ClassRef ref)
For example, given a definition of interface Map<K,V> {...} and a reference Map<String,Integer>,
the mapping will be {K -> String, V -> Integer}.
Raw references, that is, references that do not contain generic arguments (like Map) are accepted and always return
an empty result.
However, if the reference does contain generic arguments, their count must be equal to the definition.
ref - The class reference to evaluate. The corresponding definition will be loaded using GetDefinitionpublic static Map<String,TypeRef> getGenericArgumentsMappings(ClassRef ref, TypeDef definition)
For example, given a definition of interface Map<K,V> {...} and a reference Map<String,Integer>,
the mapping will be {K -> String, V -> Integer}.
Raw references, that is, references that do not contain generic arguments (like Map) are accepted and always return
an empty result.
However, if the reference does contain generic arguments, their count must be equal to the definition.
ref - The class reference to evaluate.definition - The corresponding definitionCopyright © 2023. All rights reserved.