@Override public Class<T> getType() { int index = getIndex(variable); if (owningType instanceof ParameterizedType && index != -1) { Type fieldType = ((ParameterizedType) owningType).getActualTypeArguments()[index]; return resolveType(fieldType); } return resolveType(variable); }
return new TypeVariableTypeInformation(variable, this);
/** * Returns the index of the type parameter binding the given {@link TypeVariable}. * * @param variable * @return */ private int getIndex(TypeVariable<?> variable) { Class<?> rawType = resolveType(owningType); TypeVariable<?>[] typeParameters = rawType.getTypeParameters(); for (int i = 0; i < typeParameters.length; i++) { if (variable.equals(typeParameters[i])) { return i; } } return -1; }
return new TypeVariableTypeInformation(variable, type, this, variableMap);
@Override public int hashCode() { int result = 17; result += 31 * nullSafeHashCode(getType()); return result; }