Package org.jivesoftware.smack.util
Class Objects
java.lang.Object
org.jivesoftware.smack.util.Objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic <T> TrequireNonNull(T obj) static <T> TrequireNonNull(T obj, String message) Checks that the specified object reference is notnulland throws a customizedIllegalArgumentExceptionif 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 notnulland throws a customizedIllegalArgumentExceptionif it is.Note that unlike
java.util.Objects, this method throws anIllegalArgumentExceptioninstead 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 aIllegalArgumentExceptionis thrown.- Returns:
objif not null.- Throws:
IllegalArgumentException- in caseobjisnull.
-
requireNonNull
public static <T> T requireNonNull(T obj) -
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
-