Class Objects


  • public final class Objects
    extends java.lang.Object
    Since:
    1.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean equals​(java.lang.Object a, java.lang.Object b)
      Returns true if the arguments are equal to each other and false otherwise.
      static boolean isNull​(java.lang.Object obj)
      Returns true if the provided reference is null otherwise returns false.
      static void isNull​(java.lang.Object obj, ExecutableFunction executableFunction)
      Execute code if the provided reference is null.
      static boolean nonNull​(java.lang.Object obj)
      Returns true if the provided reference is non-null otherwise returns false.
      static void nonNull​(java.lang.Object obj, ExecutableFunction executableFunction)
      Execute code if the provided reference is non-null.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isNull

        public static boolean isNull​(java.lang.Object obj)
        Returns true if the provided reference is null otherwise returns false.
        Parameters:
        obj - a reference to be checked against null
        Returns:
        true if the provided reference is null otherwise false
      • isNull

        public static void isNull​(java.lang.Object obj,
                                  ExecutableFunction executableFunction)
        Execute code if the provided reference is null.
        Parameters:
        obj - a reference to be checked against null
        executableFunction - lambda function given executed if the provided reference is null.
      • nonNull

        public static boolean nonNull​(java.lang.Object obj)
        Returns true if the provided reference is non-null otherwise returns false.
        Parameters:
        obj - a reference to be checked against null
        Returns:
        true if the provided reference is non-null otherwise false
      • nonNull

        public static void nonNull​(java.lang.Object obj,
                                   ExecutableFunction executableFunction)
        Execute code if the provided reference is non-null.
        Parameters:
        obj - a reference to be checked against null
        executableFunction - lambda function given executed if the provided reference is non-null.
      • equals

        public static boolean equals​(java.lang.Object a,
                                     java.lang.Object b)
        Returns true if the arguments are equal to each other and false otherwise. Consequently, if both arguments are null, true is returned and if exactly one argument is null, false is returned. Otherwise, equality is determined by using the equals method of the first argument.
        Parameters:
        a - an object
        b - an object to be compared with a for equality
        Returns:
        true if the arguments are equal to each other and false otherwise
        See Also:
        Object.equals(Object)