@Test public void testEquals() { String str1 = "12"; int i1 = 12; Integer I1 = 12; long l1 = 12; Long L1 = 12L; float f1 = 12.12F; Float F1 = 12.12F; double d1 = 12.12; Double D1 = 12.12; assertTrue(TypeUtils.equals(null, null)); assertFalse(TypeUtils.equals(null, str1)); assertFalse(TypeUtils.equals(null, i1)); assertFalse(TypeUtils.equals(null, I1)); assertFalse(TypeUtils.equals(null, l1)); assertFalse(TypeUtils.equals(null, L1)); assertFalse(TypeUtils.equals(null, f1)); assertFalse(TypeUtils.equals(null, F1)); assertFalse(TypeUtils.equals(null, d1)); assertFalse(TypeUtils.equals(null, D1)); assertTrue(TypeUtils.equals(str1, i1)); assertTrue(TypeUtils.equals(str1, I1)); assertTrue(TypeUtils.equals(str1, L1)); assertTrue(TypeUtils.equals(i1, I1)); assertTrue(TypeUtils.equals(i1, l1)); assertTrue(TypeUtils.equals(i1, L1)); assertTrue(TypeUtils.equals(l1, I1)); assertTrue(TypeUtils.equals(f1, F1)); assertTrue(TypeUtils.equals(d1, D1)); assertTrue(TypeUtils.equals(f1, D1)); }
public static <T> boolean equals(T t1, T t2) { if (t1 == null && t2 == null) { return true; } else if (t1 != null && t2 != null) { return t1.toString().equals(t2.toString()); } else { return false; } }
TypeUtils { public static <T> boolean equals(T t1, T t2) { if (t1 == null && t2 == null) { return true; } else if (t1 != null && t2 != null) { return t1.toString().equals(t2.toString()); } else { return false; } } }
TypeUtils { public static <T> boolean equals(T t1, T t2) { if (t1 == null && t2 == null) { return true; } else if (t1 != null && t2 != null) { return t1.toString().equals(t2.toString()); } else { return false; } } private  TypeUtils(); }
TypeUtils { public static <T> boolean equals(T t1, T t2) { if (t1 == null && t2 == null) { return true; } else if (t1 != null && t2 != null) { return t1.toString().equals(t2.toString()); } else { return false; } } private  TypeUtils(); static int byteArray2Int(byte[] bytes); static long byteArray2Long(byte[] bytes); static byte[] int2ByteArray(int i); static byte[] long2ByteArray(long l); static String byteArray2Ipv4(byte[] bytes); static String byteArray2Ipv6(byte[] bytes); static String byteArray2Ip(byte[] bytes); static List<String> csv2List(String line); static byte[] Ip2byteArrayV4(String ipv4); static byte[] Ip2byteArrayV6(String ipv6); static byte[] Ip2byteArray(String ip); static String byteArray2HexString(byte[] byteArray); static String intArray2HexString(int[] intArray); static String longArray2HexString(int[] longArray); static String byteArray2Base64(byte[] value); static byte[] base642ByteArray(String base64Str); static String byte2HexString(byte b); static byte[] hexString2ByteArray(String input); static boolean string2Boolean(String str, boolean defaultValue); static int string2Int(String str, Radix radix, int defaultValue); static long string2Long(String str, Radix radix, long defaultValue); static float string2Float(String str, float defaultValue); static double string2Double(String str, double defaultValue); static long string2Size(String size, long defaultValue); static long string2TimePeriod(String timePeriod, long defaultValue); static boolean equals(T t1, T t2); static boolean maybeUpdate(T tar, T src); }
TypeUtils { public static <T> boolean equals(T t1, T t2) { if (t1 == null && t2 == null) { return true; } else if (t1 != null && t2 != null) { return t1.toString().equals(t2.toString()); } else { return false; } } private  TypeUtils(); static int byteArray2Int(byte[] bytes); static long byteArray2Long(byte[] bytes); static byte[] int2ByteArray(int i); static byte[] long2ByteArray(long l); static String byteArray2Ipv4(byte[] bytes); static String byteArray2Ipv6(byte[] bytes); static String byteArray2Ip(byte[] bytes); static List<String> csv2List(String line); static byte[] Ip2byteArrayV4(String ipv4); static byte[] Ip2byteArrayV6(String ipv6); static byte[] Ip2byteArray(String ip); static String byteArray2HexString(byte[] byteArray); static String intArray2HexString(int[] intArray); static String longArray2HexString(int[] longArray); static String byteArray2Base64(byte[] value); static byte[] base642ByteArray(String base64Str); static String byte2HexString(byte b); static byte[] hexString2ByteArray(String input); static boolean string2Boolean(String str, boolean defaultValue); static int string2Int(String str, Radix radix, int defaultValue); static long string2Long(String str, Radix radix, long defaultValue); static float string2Float(String str, float defaultValue); static double string2Double(String str, double defaultValue); static long string2Size(String size, long defaultValue); static long string2TimePeriod(String timePeriod, long defaultValue); static boolean equals(T t1, T t2); static boolean maybeUpdate(T tar, T src); static final long KB; static final long MB; static final long GB; static final long TB; static final long PB; static final long SEC; static final long MIN; static final long HOUR; static final long DAY; static final long WEEK; static final long MON; static final long QUAR; static final long YEAR; }