Package org.gcube.common.events.impl
Class Utils
java.lang.Object
org.gcube.common.events.impl.Utils
Library-wide utilities.
- Author:
- Fabio Simeoni, Luca Frosini (ISTI-CNR)
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidValidates that a string is not empty.static voidValidates that an object is not null.static voidValidates that an object is not null.static voidValidates that a string is not null and not empty.static voidValidates that a string array is not null and all its elements are not null and not empty.static voidvalid(String name, Collection<String> o) Validates that a collection is not null and all its elements are not null and not empty.
-
Method Details
-
notNull
Validates that an object is not null.- Parameters:
o- the object to validate- Throws:
IllegalArgumentException- if the object is null
-
notNull
Validates that an object is not null.- Parameters:
name- the name of the parameter for error messageso- the object to validate- Throws:
IllegalArgumentException- if the object is null
-
notEmpty
Validates that a string is not empty.- Parameters:
name- the name of the parameter for error messageso- the string to validate- Throws:
IllegalArgumentException- if the string is empty
-
valid
Validates that a string is not null and not empty.- Parameters:
name- the name of the parameter for error messageso- the string to validate- Throws:
IllegalArgumentException- if the string is null or empty
-
valid
Validates that a collection is not null and all its elements are not null and not empty.- Parameters:
name- the name of the parameter for error messageso- the collection to validate- Throws:
IllegalArgumentException- if the collection is null or contains null/empty elements
-
valid
Validates that a string array is not null and all its elements are not null and not empty.- Parameters:
name- the name of the parameter for error messageso- the array to validate- Throws:
IllegalArgumentException- if the array is null or contains null/empty elements
-