Class TypeArguments
- java.lang.Object
-
- io.sundr.model.utils.TypeArguments
-
public class TypeArguments extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static io.sundr.model.AttributeKey<io.sundr.model.TypeParamRef>ORIGINAL_TYPE_PARAMETER
-
Constructor Summary
Constructors Constructor Description TypeArguments()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RichTypeDefapply(io.sundr.model.ClassRef classRef)static RichTypeDefapply(io.sundr.model.TypeDef definition)static Map<String,io.sundr.model.TypeRef>getGenericArgumentsMappings(io.sundr.model.ClassRef ref)Given a reference to a generic class, determine a mapping between generic arguments definitions and instantiations.static Map<String,io.sundr.model.TypeRef>getGenericArgumentsMappings(io.sundr.model.ClassRef ref, io.sundr.model.TypeDef definition)Given a reference to a generic class, determine a mapping between generic arguments definitions and instantiations.
-
-
-
Method Detail
-
apply
public static RichTypeDef apply(io.sundr.model.ClassRef classRef)
-
apply
public static RichTypeDef apply(io.sundr.model.TypeDef definition)
-
getGenericArgumentsMappings
public static Map<String,io.sundr.model.TypeRef> getGenericArgumentsMappings(io.sundr.model.ClassRef ref)
Given a reference to a generic class, determine a mapping between generic arguments definitions and instantiations.For example, given a definition of
interface Map<K,V> {...}and a referenceMap<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.
- Parameters:
ref- The class reference to evaluate. The corresponding definition will be loaded usingGetDefinition
-
getGenericArgumentsMappings
public static Map<String,io.sundr.model.TypeRef> getGenericArgumentsMappings(io.sundr.model.ClassRef ref, io.sundr.model.TypeDef definition)
Given a reference to a generic class, determine a mapping between generic arguments definitions and instantiations.For example, given a definition of
interface Map<K,V> {...}and a referenceMap<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.
- Parameters:
ref- The class reference to evaluate.definition- The corresponding definition
-
-