felix@6959: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde felix@6959: * Software engineering by Intevation GmbH felix@6959: * felix@6959: * This file is Free Software under the GNU AGPL (>=v3) felix@6959: * and comes with ABSOLUTELY NO WARRANTY! Check out the felix@6959: * documentation coming with Dive4Elements River for details. felix@6959: */ felix@6959: felix@6959: package org.dive4elements.river.utils; felix@6959: felix@6959: /** Utils to deal with Comparisons. */ felix@6959: public class CompareUtil felix@6959: { felix@6959: /** Singleton. */ felix@6959: private CompareUtil() { felix@6959: } felix@6959: felix@6959: /** Return true if a and b are either both null or equal(). */ felix@6959: public static boolean areSame(T a, T b) { felix@6959: if (a == null) return b == null; felix@6959: if (b == null) return false; felix@6959: return a.equals(b); felix@6959: } felix@6959: } felix@6959: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :