Class PioneerPreconditions

java.lang.Object
org.junitpioneer.internal.PioneerPreconditions

public class PioneerPreconditions extends Object
Pioneer-internal utility class to handle preconditions. DO NOT USE THIS CLASS - IT MAY CHANGE SIGNIFICANTLY IN ANY MINOR UPDATE.
  • Constructor Details

    • PioneerPreconditions

      private PioneerPreconditions()
  • Method Details

    • notBlank

      public static String notBlank(String str, String message)
      Asserts that the supplied string is not blank.
      Parameters:
      str - the string to check
      message - the precondition violation message
      Returns:
      the supplied string
    • notBlank

      public static String notBlank(String str, Supplier<String> messageSupplier)
      Asserts that the supplied string is not blank.
      Parameters:
      str - the string to check
      messageSupplier - the precondition violation message supplier
      Returns:
      the supplied string
    • notNull

      public static <T> T notNull(T object, String message)
      Asserts that the supplied object is not null.
      Parameters:
      object - the object to check
      message - the precondition violation message
      Returns:
      the supplied object
    • notNull

      public static <T> T notNull(T object, Supplier<String> messageSupplier)
      Asserts that the supplied object is not null.
      Parameters:
      object - the object to check
      messageSupplier - the precondition violation message supplier
      Returns:
      the supplied object
    • notEmpty

      public static <T extends Collection<?>> T notEmpty(T collection, String message)
      Asserts that the supplied collection is not empty.
      Parameters:
      collection - the collection to check
      message - the precondition violation message
      Returns:
      the supplied string
    • notEmpty

      public static <T extends Collection<?>> T notEmpty(T collection, Supplier<String> messageSupplier)
      Asserts that the supplied collection is not empty.
      Parameters:
      collection - the collection to check
      messageSupplier - the precondition violation message supplier
      Returns:
      the supplied string