/** * Checks if the class in the first parameter is assignable * to one of the classes in the second or any later parameter. * * @param toFind The class to check for assignment compatibility. * @param classes The classes against which {@code toFind} should be checked. * @return {@literal true} if {@code toFind} is assignable to any one of the * specified classes. */ public static boolean containsAssignableClass(final Class<?> toFind, final Class<?> ... classes) { return indexOfFirstAssignableClass(toFind, classes) != -1; }
/** * Checks if the class in the first parameter is assignable * to one of the classes in the second or any later parameter. * * @param toFind The class to check for assignment compatibility. * @param classes The classes against which {@code toFind} should be checked. * @return {@literal true} if {@code toFind} is assignable to any one of the * specified classes. */ public static boolean containsAssignableClass(final Class<?> toFind, final Class<?> ... classes) { return indexOfFirstAssignableClass(toFind, classes) != -1; }
/** * Checks if the class in the first parameter is assignable * to one of the classes in the second or any later parameter. * * @param toFind The class to check for assignment compatibility. * @param classes The classes against which {@code toFind} should be checked. * @return {@literal true} if {@code toFind} is assignable to any one of the * specified classes. */ public static boolean containsAssignableClass(final Class<?> toFind, final Class<?> ... classes) { return indexOfFirstAssignableClass(toFind, classes) != -1; }
int queryIndex = indexOfFirstAssignableClass(String.class, parameters); if(queryIndex == -1) { throw new IllegalAnnotationUsageException("The FindByQuery annotated method '"+ method +"' of the DAO class '"+ daoClass.getName() +"' " +
int queryIndex = indexOfFirstAssignableClass(String.class, parameters); if(queryIndex == -1) { throw new IllegalAnnotationUsageException("The FindByQuery annotated method '"+ method +"' of the DAO class '"+ daoClass.getName() +"' " +