Class Objects

java.lang.Object
org.jivesoftware.smack.util.Objects

public class Objects extends Object
  • Constructor Details

    • Objects

      public Objects()
  • Method Details

    • requireNonNull

      public static <T> T requireNonNull(T obj, String message) throws IllegalArgumentException
      Checks that the specified object reference is not null and throws a customized IllegalArgumentException if it is.

      Note that unlike java.util.Objects, this method throws an IllegalArgumentException instead of an NullPointerException.

      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 a IllegalArgumentException is thrown.
      Returns:
      obj if not null.
      Throws:
      IllegalArgumentException - in case obj is null.
    • requireNonNull

      public static <T> T requireNonNull(T obj)
    • requireNonNullNorEmpty

      public static <T extends Collection<?>> T requireNonNullNorEmpty(T collection, String message)
      Require a collection to be neither null, nor empty.
      Type Parameters:
      T - Collection type
      Parameters:
      collection - collection
      message - error message
      Returns:
      collection TODO javadoc me please
    • equals

      public static boolean equals(Object a, Object b)