java.lang.Object
org.apache.wicket.util.lang.Args
Class with methods for asserting conditions on arguments.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck if argument is falsestatic booleanCheck if argument is truestatic StringChecks argument is not empty (not null and has a non-whitespace character) Note: This method overloadsnotEmpty(CharSequence, String)for performance reasons.static <T extends CharSequence>
TChecks argument is not empty (not null and has a non-whitespace character)static <T extends Collection<?>>
TChecks argument is not null or emptystatic <T> TChecks argument is not nullstatic <T extends Comparable<? super T>>
TwithinRange(T min, T max, T value, String name) Checks if argument is within a range
-
Constructor Details
-
Args
public Args()
-
-
Method Details
-
notNull
Checks argument is not null- Type Parameters:
T-- Parameters:
argument-name-- Returns:
- The 'argument' parameter
- Throws:
IllegalArgumentException
-
notEmpty
Checks argument is not empty (not null and has a non-whitespace character)- Type Parameters:
T- the type of the argument to check for emptiness- Parameters:
argument- the argument to check for emptinessname- the name to use in the error message- Returns:
- The
argumentparameter if not empty - Throws:
IllegalArgumentException- when the passedargumentis empty
-
notEmpty
Checks argument is not empty (not null and has a non-whitespace character) Note: This method overloadsnotEmpty(CharSequence, String)for performance reasons.- Parameters:
argument- the argument to check for emptinessname- the name to use in the error message- Returns:
- The
argumentparameter if not empty - Throws:
IllegalArgumentException- when the passedargumentis empty
-
notEmpty
Checks argument is not null or empty- Parameters:
collection-message-params-- Returns:
- the {code collection}
- Throws:
IllegalArgumentException- if the passed collection is either null or empty
-
notEmpty
Checks argument is not null or empty- Parameters:
collection-name-- Returns:
- the {code collection}
- Throws:
IllegalArgumentException- if the passed collection is either null or empty
-
withinRange
Checks if argument is within a range- Type Parameters:
T-- Parameters:
min-max-value-name-- Returns:
- the {code value}
- Throws:
IllegalArgumentException
-
isTrue
Check if argument is true- Parameters:
argument-msg-params-- Returns:
- argument
-
isFalse
Check if argument is false- Parameters:
argument-msg-params-- Returns:
- argument
-