/** * Get a type argument at particular index for a parameterized type. * <p/> * In case the type is not a {@link ParameterizedType parameterized type}, * the method returns {@code null}. * * @param type parameterized type. * @param index type parameter index. * @return type argument for a parameterized type at a given index, or {@code null} in case the input type is not * a parameterized type. */ public static Type getTypeArgument(final Type type, final int index) { if (type instanceof ParameterizedType) { final ParameterizedType p = (ParameterizedType) type; return fix(p.getActualTypeArguments()[index]); } return null; }
/** * Get a type argument at particular index for a parameterized type. * <p/> * In case the type is not a {@link ParameterizedType parameterized type}, * the method returns {@code null}. * * @param type parameterized type. * @param index type parameter index. * @return type argument for a parameterized type at a given index, or {@code null} in case the input type is not * a parameterized type. */ public static Type getTypeArgument(final Type type, final int index) { if (type instanceof ParameterizedType) { final ParameterizedType p = (ParameterizedType) type; return fix(p.getActualTypeArguments()[index]); } return null; }
/** * Get a type argument at particular index for a parameterized type. * <p/> * In case the type is not a {@link ParameterizedType parameterized type}, * the method returns {@code null}. * * @param type parameterized type. * @param index type parameter index. * @return type argument for a parameterized type at a given index, or {@code null} in case the input type is not * a parameterized type. */ public static Type getTypeArgument(final Type type, final int index) { if (type instanceof ParameterizedType) { final ParameterizedType p = (ParameterizedType) type; return fix(p.getActualTypeArguments()[index]); } return null; }
/** * Get a type argument at particular index for a parameterized type. * <p/> * In case the type is not a {@link ParameterizedType parameterized type}, * the method returns {@code null}. * * @param type parameterized type. * @param index type parameter index. * @return type argument for a parameterized type at a given index, or {@code null} in case the input type is not * a parameterized type. */ public static Type getTypeArgument(final Type type, final int index) { if (type instanceof ParameterizedType) { final ParameterizedType p = (ParameterizedType) type; return fix(p.getActualTypeArguments()[index]); } return null; }
/** * Get a type argument at particular index for a parameterized type. * <p/> * In case the type is not a {@link ParameterizedType parameterized type}, * the method returns {@code null}. * * @param type parameterized type. * @param index type parameter index. * @return type argument for a parameterized type at a given index, or {@code null} in case the input type is not * a parameterized type. */ public static Type getTypeArgument(final Type type, final int index) { if (type instanceof ParameterizedType) { final ParameterizedType p = (ParameterizedType) type; return fix(p.getActualTypeArguments()[index]); } return null; }
/** * Get a type argument at particular index for a parameterized type. * <p/> * In case the type is not a {@link ParameterizedType parameterized type}, * the method returns {@code null}. * * @param type parameterized type. * @param index type parameter index. * @return type argument for a parameterized type at a given index, or {@code null} in case the input type is not * a parameterized type. */ public static Type getTypeArgument(final Type type, final int index) { if (type instanceof ParameterizedType) { final ParameterizedType p = (ParameterizedType) type; return fix(p.getActualTypeArguments()[index]); } return null; }
/** * Get a type argument at particular index for a parameterized type. * <p/> * In case the type is not a {@link ParameterizedType parameterized type}, * the method returns {@code null}. * * @param type parameterized type. * @param index type parameter index. * @return type argument for a parameterized type at a given index, or {@code null} in case the input type is not * a parameterized type. */ public static Type getTypeArgument(final Type type, final int index) { if (type instanceof ParameterizedType) { final ParameterizedType p = (ParameterizedType) type; return fix(p.getActualTypeArguments()[index]); } return null; }