Package randoop.types

Class ParameterizedType

    • Field Detail

      • cache

        private static final Map<Class<?>,​GenericClassType> cache
        A cache of all ParameterizedTypes that have been created.
    • Constructor Detail

      • ParameterizedType

        public ParameterizedType()
    • Method Detail

      • forClass

        public static GenericClassType forClass​(Class<?> typeClass)
        Creates a GenericClassType for the given reflective Class object.
        Parameters:
        typeClass - the class type
        Returns:
        a generic class type for the given type
      • forType

        public static ParameterizedType forType​(Type type)
        Performs the conversion of java.lang.reflect.ParameterizedType to a ParameterizedType .
        Parameters:
        type - the reflective type object
        Returns:
        an object of type ParameterizedType
      • substitute

        public abstract ParameterizedType substitute​(Substitution substitution)
        Description copied from class: ClassOrInterfaceType
        Applies a substitution to a ReferenceType. If the type is parameterized then replaces type variables that occur, otherwise returns this type.

        This abstract method forces typing of substitutions applied to ReferenceType objects without an explicit cast.

        This abstract method allows substitutions to be applied to ClassOrInterfaceType objects without casting.

        Specified by:
        substitute in class ClassOrInterfaceType
        Parameters:
        substitution - the type substitution
        Returns:
        the type created by applying the substitution to this type
      • getGenericClassType

        public abstract GenericClassType getGenericClassType()
        Returns the GenericClassType for this parameterized type.
        Returns:
        the generic class type for this type
      • getFqName

        public String getFqName()
        Description copied from class: Type
        Returns the fully-qualified name of this type, including type arguments if this is a parameterized type. For java.util.List<T> return "java.util.List<T>".
        Overrides:
        getFqName in class ClassOrInterfaceType
        Returns:
        the fully-qualified type name for this type
      • getBinaryName

        public String getBinaryName()
        Description copied from class: Type
        Returns the binary name of this type, including type arguments if this is a parameterized type (so, it isn't really a binary name). For java.util.List<T> return "java.util.List<T>".
        Overrides:
        getBinaryName in class ClassOrInterfaceType
        Returns:
        the binary name for this type
      • getUnqualifiedBinaryName

        public String getUnqualifiedBinaryName()
        Description copied from class: Type
        Returns the name of this type without package name, but with type arguments if parameterized, and enclosing class if a member class. For instance, for java.util.List<T> would return "List<T>".
        Overrides:
        getUnqualifiedBinaryName in class ClassOrInterfaceType
        Returns:
        the unqualified name of this type