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 or in generic type comparisons.
This inner class provides value-based equality and hashing for generic type name matching.
TODO: In order to distinguish GenericsType with same name, we should add a property to keep the declaring class.
- change the signature of constructor GenericsTypeName to `GenericsTypeName(String name, ClassNode declaringClass)`
- try to fix all compilation errors(if `GenericsType` has declaringClass property, the step would be a bit easy to fix...)
- run all tests to see whether the change breaks anything
- if all tests pass, congratulations! but if some tests are broken, try to debug and find why...
-
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.
-