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 StringrequiresNotNullOrNotEmptyParameter(String name, String value) Checks if the parameter isnullor empty and throws anIllegalArgumentExceptionif it is.static <E,T extends Collection<E>>
TrequiresNotNullOrNotEmptyParameter(String name, T value) Checks if the parameter isnullor empty and throws anIllegalArgumentExceptionif it is.
-
Constructor Details
-
Assertions
public Assertions()
-
-
Method Details
-
requiresNotNullOrNotEmptyParameter
public static String requiresNotNullOrNotEmptyParameter(String name, String value) throws IllegalArgumentException Checks if the parameter isnullor empty and throws anIllegalArgumentExceptionif 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 isnullor empty and throws anIllegalArgumentExceptionif 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
-