com.coveo.feign.util.ClassUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of feign-error-decoder Show documentation
Show all versions of feign-error-decoder Show documentation
A Feign reflection error decoder that eases the pain in rethrowing checked and unchecked exceptions.
package com.coveo.feign.util;
public class ClassUtils {
private ClassUtils() {}
public static boolean isSpringFrameworkAvailable() {
return isClassAvailable(
"org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider");
}
public static boolean isSpringWebAvailable() {
return isClassAvailable("org.springframework.web.bind.annotation.RequestMapping");
}
public static boolean isClassAvailable(String fullyQualifiedName) {
try {
Class.forName(fullyQualifiedName);
return true;
} catch (Throwable e) {
}
return false;
}
}