Package randoop.types

Class ExplicitTypeVariable

  • All Implemented Interfaces:
    Comparable<Type>

    class ExplicitTypeVariable
    extends TypeVariable
    Represents a type variable that is a type parameter. (See JLS, section 4.3.)
    • Field Detail

      • variable

        private final TypeVariable<?> variable
        The type parameter.
    • Constructor Detail

      • ExplicitTypeVariable

        ExplicitTypeVariable​(TypeVariable<?> variable,
                             ParameterBound bound)
        Create a ExplicitTypeVariable for the given type parameter.
        Parameters:
        variable - the type parameter
        bound - the upper bound on the parameter
    • Method Detail

      • equals

        public boolean equals​(Object obj)

        Checks that the type parameter is equal. This may be more restrictive than desired because equivalent TypeVariable objects from different instances of the same type may be distinct.

        Overrides:
        equals in class ParameterType
        Returns:
        true if the type parameters are equal, false otherwise
      • 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>".
        Specified by:
        getFqName in class Type
        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>".
        Specified by:
        getBinaryName in class Type
        Returns:
        the binary name for this type
      • getSimpleName

        public String getSimpleName()
        Description copied from class: Type
        Returns the name of this type without type arguments or package qualifiers. For java.util.List<T>, returns "List".
        Specified by:
        getSimpleName in class Type
        Returns:
        the name of this type without type arguments
      • getReflectionTypeVariable

        TypeVariable<?> getReflectionTypeVariable()
      • isGeneric

        public boolean isGeneric​(boolean ignoreWildcards)
        Description copied from class: Type
        Indicate whether this type is generic. A type is generic if it has one or more type variables.
        Overrides:
        isGeneric in class Type
        Parameters:
        ignoreWildcards - if true, ignore wildcards; that is, treat wildcards as not making the operation generic
        Returns:
        true if this type is generic, false otherwise
      • substitute

        public ReferenceType substitute​(Substitution substitution)
        Description copied from class: ReferenceType
        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.

        Overrides:
        substitute in class TypeVariable
        Parameters:
        substitution - the type substitution
        Returns:
        the type created by applying the substitution to this type