diff options
Diffstat (limited to 'java/dagger/hilt/processor/internal/ProcessorErrors.java')
-rw-r--r-- | java/dagger/hilt/processor/internal/ProcessorErrors.java | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/java/dagger/hilt/processor/internal/ProcessorErrors.java b/java/dagger/hilt/processor/internal/ProcessorErrors.java index d75bb625e..b1578daa3 100644 --- a/java/dagger/hilt/processor/internal/ProcessorErrors.java +++ b/java/dagger/hilt/processor/internal/ProcessorErrors.java @@ -36,49 +36,6 @@ public final class ProcessorErrors { * involving any parameters to the calling method. * * @param expression a boolean expression - * @param errorMessage the exception message to use if the check fails; will be converted to a - * string using {@link String#valueOf(Object)} - * @throws BadInputException if {@code expression} is false - */ - public static void checkState( - boolean expression, - @Nullable Object errorMessage) { - if (!expression) { - throw new BadInputException(String.valueOf(errorMessage)); - } - } - - /** - * Ensures the truth of an expression involving the state of the calling instance, but not - * involving any parameters to the calling method. - * - * @param expression a boolean expression - * @param errorMessageTemplate a template for the exception message should the check fail. The - * message is formed by replacing each {@code %s} placeholder in the template with an - * argument. These are matched by position - the first {@code %s} gets {@code - * errorMessageArgs[0]}, etc. Unmatched arguments will be appended to the formatted message in - * square braces. Unmatched placeholders will be left as-is. - * @param errorMessageArgs the arguments to be substituted into the message template. Arguments - * are converted to strings using {@link String#valueOf(Object)}. - * @throws BadInputException if {@code expression} is false - * @throws NullPointerException if the check fails and either {@code errorMessageTemplate} or - * {@code errorMessageArgs} is null (don't let this happen) - */ - @FormatMethod - public static void checkState( - boolean expression, - @Nullable @FormatString String errorMessageTemplate, - @Nullable Object... errorMessageArgs) { - if (!expression) { - throw new BadInputException(String.format(errorMessageTemplate, errorMessageArgs)); - } - } - - /** - * Ensures the truth of an expression involving the state of the calling instance, but not - * involving any parameters to the calling method. - * - * @param expression a boolean expression * @param badElement the element that was at fault * @param errorMessage the exception message to use if the check fails; will be converted to a * string using {@link String#valueOf(Object)} |