Class PreconditionUtils

    • Method Detail

      • checkArgument

        public static void checkArgument​(boolean expression)
        Ensures the truth of an expression involving one or more parameters to the calling method.
        Parameters:
        expression - a boolean expression
        Throws:
        IllegalArgumentException - if expression is false
      • checkArgument

        public static void checkArgument​(boolean expression,
                                         @Nullable
                                         Object errorMessage)
        Ensures the truth of an expression involving one or more parameters to the calling method.
        Parameters:
        expression - a boolean expression
        errorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(Object)
        Throws:
        IllegalArgumentException - if expression is false