Package org.codehaus.groovy.ast
Class GenericsType.GenericsTypeName
java.lang.Object
org.codehaus.groovy.ast.GenericsType.GenericsTypeName
- Enclosing class:
- GenericsType
Represents the name of a
GenericsType for use as a map key.
Equality and hashing are name-only: that is the JLS 6.4.1 in-scope
lookup rule and the JVMS 4.7.9.1 TypeVariableSignature spelling.
Type-variable identity (class T vs method T)
lives on GenericsType.getGenericDeclaration(), not on this key.
Do not add a declaring class to equals/hashCode: mixed
null-owner keys are not an equivalence, and substitution maps that mean
"in this scope, name T means String" would stop matching uses.
-
Constructor Summary
ConstructorsConstructorDescriptionGenericsTypeName(String name) Creates a generics type name with the specified string. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this GenericsTypeName with another object for equality based on the type name.getName()Returns the generic type name.inthashCode()Returns the hash code based on the type name.toString()Returns the string representation of this generics type name.
-
Constructor Details
-
GenericsTypeName
Creates a generics type name with the specified string.- Parameters:
name- the generic type name (never null)- Throws:
NullPointerException- if name is null
-
-
Method Details
-
getName
Returns the generic type name.- Returns:
- the name
-
equals
Compares this GenericsTypeName with another object for equality based on the type name. -
hashCode
public int hashCode()Returns the hash code based on the type name. -
toString
Returns the string representation of this generics type name.
-