Package org.wildfly.plugin.tools.util
Class Assertions
java.lang.Object
org.wildfly.plugin.tools.util.Assertions
A utility for assertions.
- Author:
- James R. Perkins
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
requiresNotNullOrNotEmptyParameter
(String name, String value) Checks if the parameter isnull
or empty and throws anIllegalArgumentException
if it is.static <E,
T extends Collection<E>>
TrequiresNotNullOrNotEmptyParameter
(String name, T value) Checks if the parameter isnull
or empty and throws anIllegalArgumentException
if it is.
-
Constructor Details
-
Assertions
public Assertions()
-
-
Method Details
-
requiresNotNullOrNotEmptyParameter
public static String requiresNotNullOrNotEmptyParameter(String name, String value) throws IllegalArgumentException Checks if the parameter isnull
or empty and throws anIllegalArgumentException
if it is.- Parameters:
name
- the name of the parametervalue
- the value to check- Returns:
- the parameter value
- Throws:
IllegalArgumentException
- if the object representing the parameter isnull
-
requiresNotNullOrNotEmptyParameter
public static <E,T extends Collection<E>> T requiresNotNullOrNotEmptyParameter(String name, T value) throws IllegalArgumentException Checks if the parameter isnull
or empty and throws anIllegalArgumentException
if it is.- Parameters:
name
- the name of the parametervalue
- the value to check- Returns:
- the parameter value
- Throws:
IllegalArgumentException
- if the object representing the parameter isnull
-