/** * Learn whether {@code t} equals {@code w}. * @param w LHS * @param t RHS * @return boolean */ private static boolean equals(final WildcardType w, final Type t) { if (t instanceof WildcardType) { final WildcardType other = (WildcardType) t; return equals(getImplicitLowerBounds(w), getImplicitLowerBounds(other)) && equals(getImplicitUpperBounds(w), getImplicitUpperBounds(other)); } return false; }
/** * Learn whether {@code t} equals {@code w}. * @param w LHS * @param t RHS * @return boolean */ private static boolean equals(final WildcardType w, final Type t) { if (t instanceof WildcardType) { final WildcardType other = (WildcardType) t; return equals(getImplicitLowerBounds(w), getImplicitLowerBounds(other)) && equals(getImplicitUpperBounds(w), getImplicitUpperBounds(other)); } return false; }
/** * Learn whether {@code t} equals {@code w}. * @param w LHS * @param t RHS * @return boolean */ private static boolean equals(final WildcardType w, final Type t) { if (t instanceof WildcardType) { final WildcardType other = (WildcardType) t; return equals(getImplicitLowerBounds(w), getImplicitLowerBounds(other)) && equals(getImplicitUpperBounds(w), getImplicitUpperBounds(other)); } return false; }
/** * Learn, recursively, whether any of the type parameters associated with {@code type} are bound to variables. * * @param type the type to check for type variables * @return boolean */ public static boolean containsTypeVariables(final Type type) { if (type instanceof TypeVariable<?>) { return true; } if (type instanceof Class<?>) { return ((Class<?>) type).getTypeParameters().length > 0; } if (type instanceof ParameterizedType) { for (final Type arg : ((ParameterizedType) type).getActualTypeArguments()) { if (containsTypeVariables(arg)) { return true; } } return false; } if (type instanceof WildcardType) { final WildcardType wild = (WildcardType) type; return containsTypeVariables(TypeUtils.getImplicitLowerBounds(wild)[0]) || containsTypeVariables(TypeUtils.getImplicitUpperBounds(wild)[0]); } return false; }
/** * Learn, recursively, whether any of the type parameters associated with {@code type} are bound to variables. * * @param type the type to check for type variables * @return boolean */ public static boolean containsTypeVariables(final Type type) { if (type instanceof TypeVariable<?>) { return true; } if (type instanceof Class<?>) { return ((Class<?>) type).getTypeParameters().length > 0; } if (type instanceof ParameterizedType) { for (final Type arg : ((ParameterizedType) type).getActualTypeArguments()) { if (containsTypeVariables(arg)) { return true; } } return false; } if (type instanceof WildcardType) { final WildcardType wild = (WildcardType) type; return containsTypeVariables(TypeUtils.getImplicitLowerBounds(wild)[0]) || containsTypeVariables(TypeUtils.getImplicitUpperBounds(wild)[0]); } return false; }
/** * Learn, recursively, whether any of the type parameters associated with {@code type} are bound to variables. * * @param type the type to check for type variables * @return boolean */ public static boolean containsTypeVariables(final Type type) { if (type instanceof TypeVariable<?>) { return true; } if (type instanceof Class<?>) { return ((Class<?>) type).getTypeParameters().length > 0; } if (type instanceof ParameterizedType) { for (final Type arg : ((ParameterizedType) type).getActualTypeArguments()) { if (containsTypeVariables(arg)) { return true; } } return false; } if (type instanceof WildcardType) { final WildcardType wild = (WildcardType) type; return containsTypeVariables(TypeUtils.getImplicitLowerBounds(wild)[0]) || containsTypeVariables(TypeUtils.getImplicitUpperBounds(wild)[0]); } return false; }
final Type[] toLowerBounds = getImplicitLowerBounds(toWildcardType); final Type[] lowerBounds = getImplicitLowerBounds(wildcardType);
final Type[] toLowerBounds = getImplicitLowerBounds(toWildcardType); final Type[] lowerBounds = getImplicitLowerBounds(wildcardType);
final Type[] toLowerBounds = getImplicitLowerBounds(toWildcardType); final Type[] lowerBounds = getImplicitLowerBounds(wildcardType);