Class Assert

java.lang.Object
net.adoptopenjdk.icedteaweb.Assert

public class Assert extends Object
  • Field Details

  • Constructor Details

    • Assert

      private Assert()
  • Method Details

    • requireNonNull

      public static <T> T requireNonNull(T value, String argumentName)
      Checks that the specified value is null and throws NullPointerException with a customized error message if it is.
      Type Parameters:
      T - type of the value
      Parameters:
      value - the value to be checked.
      argumentName - the name of the argument to be used in the error message.
      Returns:
      the value.
    • requireNonBlank

      public static String requireNonBlank(String str, String argumentName)
      Checks that the specified str blank, throws IllegalArgumentException with a customized error message if it is.
      Parameters:
      str - the value to be checked.
      argumentName - the name of the argument to be used in the error message.
      Returns:
      the str.
      Throws:
      NullPointerException - if str is null.
      IllegalArgumentException - if str is blank.
      See Also: