io.redskap.swagger.brake.util.ExceptionUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swagger-brake Show documentation
Show all versions of swagger-brake Show documentation
Swagger contract checker for breaking API changes
package io.redskap.swagger.brake.util;
import java.util.Optional;
public abstract class ExceptionUtils {
public static Optional findInChain(Throwable throwable, Class type) {
return org.apache.commons.lang3.exception.ExceptionUtils.getThrowableList(throwable)
.stream()
.filter(type::isInstance)
.findFirst().map(type::cast);
}
}