Package org.jxmpp.util
Class Objects
- java.lang.Object
-
- org.jxmpp.util.Objects
-
public class Objects extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Objects()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
requireNonNull(T obj, java.lang.String parameterName)
Checks that the specified object reference is notnull
and throws a customizedIllegalArgumentException
if it is.
-
-
-
Method Detail
-
requireNonNull
public static <T> T requireNonNull(T obj, java.lang.String parameterName) throws java.lang.IllegalArgumentException
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.parameterName
- the name of the parameter which is null- Returns:
obj
if not null.- Throws:
java.lang.IllegalArgumentException
- in caseobj
isnull
.
-
-