Package org.wildfly.plugin.tools.util
Class Assertions
- java.lang.Object
-
- org.wildfly.plugin.tools.util.Assertions
-
public class Assertions extends Object
A utility for assertions.- Author:
- James R. Perkins
-
-
Constructor Summary
Constructors Constructor Description Assertions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.
-
-
-
Method Detail
-
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
-
-