Class Assert

java.lang.Object
io.micronaut.jms.util.Assert

public abstract class Assert extends Object
Assertion utility methods.
Since:
1.0.0
Author:
Burt Beckwith
  • Constructor Details

    • Assert

      public Assert()
  • Method Details

    • notNull

      public static void notNull(@Nullable @Nullable Object object, String message)
      Throws an IllegalArgumentException if the object is null.
      Parameters:
      object - the object
      message - the exception message to use if null
      Throws:
      IllegalArgumentException - if the object is null
    • notNull

      public static void notNull(@Nullable @Nullable Object object, @NonNull @NonNull Supplier<String> message)
      Throws an IllegalArgumentException if the object is null.
      Parameters:
      object - the object
      message - the exception message to use if null
      Throws:
      IllegalArgumentException - if the object is null
    • isTrue

      public static void isTrue(boolean expression, @NonNull @NonNull Supplier<String> message)
      Throws an IllegalArgumentException if the boolean expression is false.
      Parameters:
      expression - a boolean expression
      message - the exception message to use if false
      Throws:
      IllegalArgumentException - if the expression is false