Class GenericMetadataSupport.TypeVarBoundedType
java.lang.Object
org.mockito.internal.util.reflection.GenericMetadataSupport.TypeVarBoundedType
- All Implemented Interfaces:
Type
,GenericMetadataSupport.BoundedType
- Enclosing class:
- GenericMetadataSupport
public static class GenericMetadataSupport.TypeVarBoundedType
extends 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<E extends Comparable & Cloneable> {
E get();
}
// will return Comparable type
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
Type[]
On a Type Variable (typeVar extends C_0 & I_1 & I_2 & etc), will return an array containing I_1 and I_2.toString()
TypeVariable<?>
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.reflect.Type
getTypeName
-
Field Details
-
typeVariable
-
-
Constructor Details
-
TypeVarBoundedType
-
-
Method Details
-
firstBound
- Specified by:
firstBound
in interfaceGenericMetadataSupport.BoundedType
- Returns:
- either a class or an interface (parameterized or not), if no bounds declared Object is returned.
-
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 interfaceGenericMetadataSupport.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
-
hashCode
public int hashCode() -
toString
-
typeVariable
-