GenericMetadataSupport.TypeVarBoundedType
Date: 2015-09-18

org.mockito.internal.util.reflection

## Class GenericMetadataSupport.TypeVarBoundedType

- java.lang.Object
- - org.mockito.internal.util.reflection.GenericMetadataSupport.TypeVarBoundedType

- All Implemented Interfaces:
    java.lang.reflect.Type, GenericMetadataSupport.BoundedType
  Enclosing class:
    GenericMetadataSupport

      public static class GenericMetadataSupport.TypeVarBoundedType
      extends java.lang.Object
      implements GenericMetadataSupport.BoundedType

  Type representing bounds of a type variable, allows to keep all bounds information.

  It uses the first bound in the array, as this array is never null and always contains at least one element (Object is always here if no bounds are declared).

  If upper bounds are declared with SomeClass and additional interfaces, then firstBound will be SomeClass and interfacesBound will be an array of the additional interfaces. i.e. `SomeClass`.

           interface UpperBoundedTypeWithClass & Cloneable> {
               E get();
           }
           // will return Comparable type

  See Also:
    http://docs.oracle.com/javase/specs/jls/se5.0/html/typesValues.html#4.4

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericMetadataSupport.TypeVarBoundedType(java.lang.reflect.TypeVariable typeVariable)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object o)`
    `java.lang.reflect.Type` | `firstBound()`
    `int` | `hashCode()`
    `java.lang.reflect.Type[]` | `interfaceBounds()` On a Type Variable (typeVar extends C_0 & I_1 & I_2 & etc), will return an array containing I_1 and I_2.
    `java.lang.String` | `toString()`
    `java.lang.reflect.TypeVariable` | `typeVariable()`

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

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

- - ### Constructor Detail

    - #### GenericMetadataSupport.TypeVarBoundedType

          public GenericMetadataSupport.TypeVarBoundedType(java.lang.reflect.TypeVariable typeVariable)

  - ### Method Detail

    - #### firstBound

          public java.lang.reflect.Type firstBound()

      Specified by:
        `firstBound` in interface `GenericMetadataSupport.BoundedType`
      Returns:
        either a class or an interface (parameterized or not), if no bounds declared Object is returned.

    - #### interfaceBounds

          public java.lang.reflect.Type[] interfaceBounds()

      On a Type Variable (typeVar extends C_0 & I_1 & I_2 & etc), will return an array containing I_1 and I_2.
      Specified by:
        `interfaceBounds` in interface `GenericMetadataSupport.BoundedType`
      Returns:
        other bounds for this type, these bounds can only be only interfaces as the JLS says, empty array if no other bound declared.

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### typeVariable

          public java.lang.reflect.TypeVariable typeVariable()