Class TypeArguments


  • public class TypeArguments
    extends Object
    • Field Detail

      • ORIGINAL_TYPE_PARAMETER

        public static final io.sundr.model.AttributeKey<io.sundr.model.TypeParamRef> ORIGINAL_TYPE_PARAMETER
    • Constructor Detail

      • TypeArguments

        public TypeArguments()
    • 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 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.

        Parameters:
        ref - The class reference to evaluate. The corresponding definition will be loaded using GetDefinition
      • 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 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.

        Parameters:
        ref - The class reference to evaluate.
        definition - The corresponding definition