Class Asserts

java.lang.Object
com.auth0.utils.Asserts

public abstract class Asserts extends Object
  • Constructor Details

    • Asserts

      public Asserts()
  • Method Details

    • assertNotNull

      public static void assertNotNull(Object value, String name)
      Asserts that an object is not null.
      Parameters:
      value - the value to check.
      name - the name of the parameter, used when creating the exception message.
      Throws:
      IllegalArgumentException - if the value is null
    • assertValidUrl

      public static void assertValidUrl(String value, String name)
      Asserts that a value is a valid URL.
      Parameters:
      value - the value to check.
      name - the name of the parameter, used when creating the exception message.
      Throws:
      IllegalArgumentException - if the value is null or is not a valid URL.
    • assertNotEmpty

      public static void assertNotEmpty(Collection<?> value, String name)
      Asserts that a collection is not null and has at least one item.
      Parameters:
      value - the value to check.
      name - the name of the parameter, used when creating the exception message.
      Throws:
      IllegalArgumentException - if the value is null or has length of zero.