public static void checkFormat(boolean isOK, String template, Object...args) throws GplazmaParseMapFileException { Exceptions.genericCheck(isOK, GplazmaParseMapFileException::new, template, args); }
public static void checkThirdPartyTransferSuccessful(boolean isSuccessful, String template, Object...arguments) throws ThirdPartyTransferFailedCacheException { Exceptions.genericCheck(isSuccessful, ThirdPartyTransferFailedCacheException::new, template, arguments); }
public static void checkResourceNotMissing(boolean isOK, String format, Object...arguments) throws MissingResourceCacheException { genericCheck(isOK, MissingResourceCacheException::new, format, arguments); }
/** * A utility method that throws an exception if the first argument is false. * @param isAuthenticated boolean value. * @param message an explanation of why the exception was thrown. * @throws AuthenticationException if isAuthenticated is false */ public static void checkAuthentication(boolean isAuthenticated, String message) throws AuthenticationException { genericCheck(isAuthenticated, AuthenticationException::new, message); } }
public static <E extends Exception> void checkChildName(String name, Function<String,E> toException) throws E { genericCheck(!name.isEmpty(), toException, "Name must be non-empty."); genericCheck(!name.contains("/"), toException, "Name must not contain '/'."); genericCheck(!name.equals("."), toException, "Name must not be '.'."); genericCheck(!name.equals(".."), toException, "Name must not be '..'."); }
public static void checkCommand(boolean isOK, String format, Object... arguments) throws CommandException { genericCheck(isOK, m -> new CommandException(m), format, arguments); } }