Package org.jivesoftware.smack.util
Class Objects
java.lang.Object
org.jivesoftware.smack.util.Objects
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static <T> T
requireNonNull
(T obj) static <T> T
requireNonNull
(T obj, String message) Checks that the specified object reference is notnull
and throws a customizedIllegalArgumentException
if it is.static <T extends Collection<?>>
TrequireNonNullNorEmpty
(T collection, String message) Require a collection to be neither null, nor empty.
-
Constructor Details
-
Objects
public Objects()
-
-
Method Details
-
requireNonNull
Checks that the specified object reference is notnull
and throws a customizedIllegalArgumentException
if it is.Note that unlike
java.util.Objects
, this method throws anIllegalArgumentException
instead of anNullPointerException
.- Type Parameters:
T
- the type of the reference.- Parameters:
obj
- the object reference to check for nullity.message
- detail message to be used in the event that aIllegalArgumentException
is thrown.- Returns:
obj
if not null.- Throws:
IllegalArgumentException
- in caseobj
isnull
.
-
requireNonNull
-
requireNonNullNorEmpty
Require a collection to be neither null, nor empty.- Type Parameters:
T
- Collection type- Parameters:
collection
- collectionmessage
- error message- Returns:
- collection TODO javadoc me please
-
equals
-