Package org.jivesoftware.smack.util
Class Objects
- java.lang.Object
-
- org.jivesoftware.smack.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 boolean
equals(java.lang.Object a, java.lang.Object b)
static <T> T
requireNonNull(T obj)
static <T> T
requireNonNull(T obj, java.lang.String message)
Checks that the specified object reference is notnull
and throws a customizedIllegalArgumentException
if it is.static <T extends java.util.Collection<?>>
TrequireNonNullNorEmpty(T collection, java.lang.String message)
Require a collection to be neither null, nor empty.
-
-
-
Constructor Detail
-
Objects
public Objects()
-
-
Method Detail
-
requireNonNull
public static <T> T requireNonNull(T obj, java.lang.String message) 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.message
- detail message to be used in the event that aIllegalArgumentException
is thrown.- Returns:
obj
if not null.- Throws:
java.lang.IllegalArgumentException
- in caseobj
isnull
.
-
requireNonNull
public static <T> T requireNonNull(T obj)
-
requireNonNullNorEmpty
public static <T extends java.util.Collection<?>> T requireNonNullNorEmpty(T collection, java.lang.String message)
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
public static boolean equals(java.lang.Object a, java.lang.Object b)
-
-