/** * Returns an unhealthy {@link Result} with the given error. * * @param error an exception thrown during the health check * @return an unhealthy {@link Result} with the given error */ public static Result unhealthy(Throwable error) { return new Result(false, error.getMessage(), error); }
/** * Returns a healthy {@link Result} with an additional message. * * @param message an informative message * @return a healthy {@link Result} with an additional message */ public static Result healthy(String message) { return new Result(true, message, null); }
/** * Returns an unhealthy {@link Result} with the given message. * * @param message an informative message describing how the health check failed * @return an unhealthy {@link Result} with the given message */ public static Result unhealthy(String message) { return new Result(false, message, null); }