Example usage for java.lang.reflect GenericDeclaration toString

List of usage examples for java.lang.reflect GenericDeclaration toString

Introduction

In this page you can find the example usage for java.lang.reflect GenericDeclaration toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:net.firejack.platform.core.utils.Factory.java

public int getParameterTypeDeclarationIndex(TypeVariable typeVariable) {
    GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration();
    TypeVariable[] typeVariables = genericDeclaration.getTypeParameters();
    for (int i = 0; i < typeVariables.length; i++) {
        if (typeVariables[i].equals(typeVariable)) {
            return i;
        }/* www. j  ava2s  .c om*/
    }
    throw new IllegalStateException(
            "Argument " + typeVariable.toString() + " is not found in " + genericDeclaration.toString() + ".");
}