Here you can find the source of areEqual(T s1, T s2)
Parameter | Description |
---|---|
s1 | a parameter |
s2 | a parameter |
public static <T> boolean areEqual(T s1, T s2)
//package com.java2s; /**/* ww w . j a v a 2s . c om*/ * Aptana Studio * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions). * Please see the license.html included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ public class Main { /** * Compares two objects of the same type for equality taking into account that none, one, or both may be null * * @param s1 * @param s2 * @return */ public static <T> boolean areEqual(T s1, T s2) { return (s1 == null) ? (s2 == null) : (s2 != null) ? s1.equals(s2) : false; } }