Package org.sonar.java.resolve
Class ParametrizedTypeJavaType
- java.lang.Object
-
- org.sonar.java.resolve.JavaType
-
- org.sonar.java.resolve.ClassJavaType
-
- org.sonar.java.resolve.ParametrizedTypeJavaType
-
- All Implemented Interfaces:
Type
public class ParametrizedTypeJavaType extends ClassJavaType
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sonar.plugins.java.api.semantic.Type
Type.ArrayType, Type.Primitives
-
-
Constructor Summary
Constructors Constructor Description ParametrizedTypeJavaType(JavaSymbol.TypeJavaSymbol symbol, TypeSubstitution typeSubstitution, TypeSubstitutionSolver typeSubstitutionSolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaTypeerasure()JLS8 4.6booleanisSubtypeOf(Type superType)Check whether a type is a subtype of another.protected ClassJavaTypesubstitutedType(ClassJavaType type)JavaTypesubstitution(TypeVariableJavaType typeVariableType)List<TypeVariableJavaType>typeParameters()-
Methods inherited from class org.sonar.java.resolve.ClassJavaType
directSuperTypes, getSuperType, is, isSubtypeOf, superTypes
-
Methods inherited from class org.sonar.java.resolve.JavaType
fullyQualifiedName, getSymbol, isArray, isClass, isNumerical, isParameterized, isPrimitive, isPrimitive, isPrimitiveWrapper, isTagged, isUnknown, isVoid, name, primitiveType, primitiveWrapperType, symbol, toString
-
-
-
-
Constructor Detail
-
ParametrizedTypeJavaType
public ParametrizedTypeJavaType(JavaSymbol.TypeJavaSymbol symbol, TypeSubstitution typeSubstitution, TypeSubstitutionSolver typeSubstitutionSolver)
-
-
Method Detail
-
substitution
@Nullable public JavaType substitution(TypeVariableJavaType typeVariableType)
-
typeParameters
public List<TypeVariableJavaType> typeParameters()
-
isSubtypeOf
public boolean isSubtypeOf(Type superType)
Description copied from interface:TypeCheck whether a type is a subtype of another.This method will consider implemented interfaces as well as superclasses.
Type type, myOtherType; type.isSubtypeOf(myOtherType);
- Specified by:
isSubtypeOfin interfaceType- Overrides:
isSubtypeOfin classClassJavaType- Parameters:
superType- instance of a potential superType.- Returns:
- true if types are equivalent or if the one passed in parameter is in the hierarchy. false otherwise.
-
substitutedType
protected ClassJavaType substitutedType(ClassJavaType type)
- Overrides:
substitutedTypein classClassJavaType
-
-