Package org.jsoup.helper
Class Validate
java.lang.Object
org.jsoup.helper.Validate
public final class Validate extends Object
Simple validation methods. Designed for jsoup internal use
-
Method Summary
Modifier and Type Method Description static voidfail(String msg)Cause a failure.static voidisFalse(boolean val)Validates that the value is falsestatic voidisFalse(boolean val, String msg)Validates that the value is falsestatic voidisTrue(boolean val)Validates that the value is truestatic voidisTrue(boolean val, String msg)Validates that the value is truestatic voidnoNullElements(Object[] objects)Validates that the array contains no null elementsstatic voidnoNullElements(Object[] objects, String msg)Validates that the array contains no null elementsstatic voidnotEmpty(String string)Validates that the string is not null and is not emptystatic voidnotEmpty(String string, String msg)Validates that the string is not null and is not emptystatic voidnotNull(Object obj)Validates that the object is not nullstatic voidnotNull(Object obj, String msg)Validates that the object is not nullstatic voidwtf(String msg)Blow up if we reach an unexpected state.
-
Method Details
-
notNull
Validates that the object is not null- Parameters:
obj- object to test
-
notNull
Validates that the object is not null- Parameters:
obj- object to testmsg- message to output if validation fails
-
isTrue
public static void isTrue(boolean val)Validates that the value is true- Parameters:
val- object to test
-
isTrue
Validates that the value is true- Parameters:
val- object to testmsg- message to output if validation fails
-
isFalse
public static void isFalse(boolean val)Validates that the value is false- Parameters:
val- object to test
-
isFalse
Validates that the value is false- Parameters:
val- object to testmsg- message to output if validation fails
-
noNullElements
Validates that the array contains no null elements- Parameters:
objects- the array to test
-
noNullElements
Validates that the array contains no null elements- Parameters:
objects- the array to testmsg- message to output if validation fails
-
notEmpty
Validates that the string is not null and is not empty- Parameters:
string- the string to test
-
notEmpty
Validates that the string is not null and is not empty- Parameters:
string- the string to testmsg- message to output if validation fails
-
wtf
Blow up if we reach an unexpected state.- Parameters:
msg- message to think about
-
fail
Cause a failure.- Parameters:
msg- message to output.
-