Java Object Compare areEqual(T obj1, V obj2)

Here you can find the source of areEqual(T obj1, V obj2)

Description

are Equal

License

Open Source License

Declaration

public static <T, V> void areEqual(T obj1, V obj2) 

Method Source Code

//package com.java2s;
/**//from www  .ja  v  a 2  s. c om
 * Copyright 2010 ZTEsoft Inc. All Rights Reserved.
 *
 * This software is the proprietary information of ZTEsoft Inc.
 * Use is subject to license terms.
 * 
 * $Tracker List
 * 
 * $TaskId: $ $Date: 9:24:36 AM (May 9, 2008) $comments: create 
 * $TaskId: $ $Date: 3:56:36 PM (SEP 13, 2010) $comments: upgrade jvm to jvm1.5 
 *  
 *  
 */

public class Main {
    public static <T, V> void areEqual(T obj1, V obj2, String msg) {
        if (!obj1.equals(obj2)) {
            throw new IllegalArgumentException(msg);
        }
    }

    public static <T, V> void areEqual(T obj1, V obj2) {
        areEqual(obj1, obj2, "The object is not equal.");
    }
}

Related

  1. areEqual(Object one, Object another)
  2. areEqual(Object parameter, Object otherParameter)
  3. areEqual(Object value, Object otherValue)
  4. areEqual(Object value1, Object value2)
  5. areEqual(T obj1, T obj2)
  6. areEqualComparables(T object1, T object2)
  7. areEqualEvenIfBothNull(Object first, Object second)
  8. areEquals(final Object o1, final Object o2)
  9. areEquals(Object a, Object b)