- java.lang.Object
-
- org.junitpioneer.internal.PioneerPreconditions
-
public class PioneerPreconditions extends java.lang.ObjectPioneer-internal utility class to handle preconditions. DO NOT USE THIS CLASS - IT MAY CHANGE SIGNIFICANTLY IN ANY MINOR UPDATE.
-
-
Constructor Summary
Constructors Modifier Constructor Description privatePioneerPreconditions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringnotBlank(java.lang.String str, java.lang.String message)Asserts that the supplied string is not blank.static java.lang.StringnotBlank(java.lang.String str, java.util.function.Supplier<java.lang.String> messageSupplier)Asserts that the supplied string is not blank.static <T extends java.util.Collection<?>>
TnotEmpty(T collection, java.lang.String message)Asserts that the supplied collection is not empty.static <T extends java.util.Collection<?>>
TnotEmpty(T collection, java.util.function.Supplier<java.lang.String> messageSupplier)Asserts that the supplied collection is not empty.static <T> TnotNull(T object, java.lang.String message)Asserts that the supplied object is not null.static <T> TnotNull(T object, java.util.function.Supplier<java.lang.String> messageSupplier)Asserts that the supplied object is not null.
-
-
-
Method Detail
-
notBlank
public static java.lang.String notBlank(java.lang.String str, java.lang.String message)Asserts that the supplied string is not blank.- Parameters:
str- the string to checkmessage- the precondition violation message- Returns:
- the supplied string
-
notBlank
public static java.lang.String notBlank(java.lang.String str, java.util.function.Supplier<java.lang.String> messageSupplier)Asserts that the supplied string is not blank.- Parameters:
str- the string to checkmessageSupplier- the precondition violation message supplier- Returns:
- the supplied string
-
notNull
public static <T> T notNull(T object, java.lang.String message)Asserts that the supplied object is not null.- Parameters:
object- the object to checkmessage- the precondition violation message- Returns:
- the supplied object
-
notNull
public static <T> T notNull(T object, java.util.function.Supplier<java.lang.String> messageSupplier)Asserts that the supplied object is not null.- Parameters:
object- the object to checkmessageSupplier- the precondition violation message supplier- Returns:
- the supplied object
-
notEmpty
public static <T extends java.util.Collection<?>> T notEmpty(T collection, java.lang.String message)Asserts that the supplied collection is not empty.- Parameters:
collection- the collection to checkmessage- the precondition violation message- Returns:
- the supplied string
-
notEmpty
public static <T extends java.util.Collection<?>> T notEmpty(T collection, java.util.function.Supplier<java.lang.String> messageSupplier)Asserts that the supplied collection is not empty.- Parameters:
collection- the collection to checkmessageSupplier- the precondition violation message supplier- Returns:
- the supplied string
-
-