All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.javagimmicks.lang.LangUtils Maven / Gradle / Ivy

There is a newer version: 0.99-alpha1
Show newest version
package net.sf.javagimmicks.lang;

/**
 * Some basic utility methods - currently only for comparing objects in a
 * null-safe way.
 */
public class LangUtils
{
   public static boolean equalsNullSafe(final Object o1, final Object o2)
   {
      return (o1 == o2) || (o1 != null && o1.equals(o2));
   }

   public static int hashCodeNullSafe(final Object o)
   {
      return o != null ? o.hashCode() : 0;
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy