/** * Creates a new successful result. * @return a new instance. */ public static WaitResult success() { return new WaitResult(Optional.empty()); }
/** * Creates a failed result. Uses {@link String#format(String, Object...)} to replace * portions of the {@code message}. * * @param message the failure message. * @param replacements any string replacements for the message. * @return a new instance. */ public static WaitResult failure(String message, Object... replacements) { return new WaitResult(Optional.of(String.format(message, replacements))); }