org.codehaus.groovy.ast

## Class GenericsType

- java.lang.Object
- - org.codehaus.groovy.ast.ASTNode
  - - org.codehaus.groovy.ast.GenericsType

- All Implemented Interfaces:
    NodeMetaDataHandler

      public class GenericsType
      extends ASTNode

  This class is used to describe generic type signatures for ClassNodes.
  See Also:
    `ClassNode`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GenericsType.GenericsTypeName` Represents GenericsType name TODO In order to distinguish GenericsType with same name(See GROOVY-8409), we should add a property to keep the declaring class.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static GenericsType[]` | `EMPTY_ARRAY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericsType(ClassNode basicType)`
    `GenericsType(ClassNode type, ClassNode[] upperBounds, ClassNode lowerBound)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClassNode` | `getLowerBound()`
    `String` | `getName()`
    `ClassNode` | `getType()`
    `ClassNode[]` | `getUpperBounds()`
    `boolean` | `isCompatibleWith(ClassNode classNode)` Compares this generics type with the provided class node.
    `boolean` | `isPlaceholder()`
    `boolean` | `isResolved()`
    `boolean` | `isWildcard()`
    `void` | `setName(String name)`
    `void` | `setPlaceholder(boolean placeholder)`
    `void` | `setResolved(boolean resolved)`
    `void` | `setType(ClassNode type)`
    `void` | `setWildcard(boolean wildcard)`
    `String` | `toString()`

    - ### Methods inherited from class org.codehaus.groovy.ast.ASTNode

      `copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, hashCode, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.codehaus.groovy.ast.NodeMetaDataHandler

      `copyNodeMetaData, getNodeMetaData, getNodeMetaData, getNodeMetaData, putNodeMetaData, removeNodeMetaData, setNodeMetaData`

- - ### Field Detail

    - #### EMPTY_ARRAY

          public static final GenericsType[] EMPTY_ARRAY

  - ### Constructor Detail

    - #### GenericsType

          public GenericsType(ClassNode type,
                              ClassNode[] upperBounds,
                              ClassNode lowerBound)

    - #### GenericsType

          public GenericsType(ClassNode basicType)

  - ### Method Detail

    - #### getType

          public ClassNode getType()

    - #### setType

          public void setType(ClassNode type)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getName

          public String getName()

    - #### setName

          public void setName(String name)

    - #### isResolved

          public boolean isResolved()

    - #### setResolved

          public void setResolved(boolean resolved)

    - #### isPlaceholder

          public boolean isPlaceholder()

    - #### setPlaceholder

          public void setPlaceholder(boolean placeholder)

    - #### isWildcard

          public boolean isWildcard()

    - #### setWildcard

          public void setWildcard(boolean wildcard)

    - #### getLowerBound

          public ClassNode getLowerBound()

    - #### getUpperBounds

          public ClassNode[] getUpperBounds()

    - #### isCompatibleWith

          public boolean isCompatibleWith(ClassNode classNode)

      Compares this generics type with the provided class node. If the provided class node is compatible with the generics specification, returns true. Otherwise, returns false. The check is complete, meaning that nested generics are also checked.
      Returns:
        if `classNode` is or is not compatible with this generics specification