Package org.apache.ibatis.reflection
Class ArrayUtil
- java.lang.Object
-
- org.apache.ibatis.reflection.ArrayUtil
-
public class ArrayUtil extends java.lang.ObjectProvides hashCode, equals and toString methods that can handle array.
-
-
Constructor Summary
Constructors Constructor Description ArrayUtil()
-
Method Summary
Modifier and Type Method Description static booleanequals(java.lang.Object thisObj, java.lang.Object thatObj)Compares two objects.static inthashCode(java.lang.Object obj)Returns a hash code forobj.static java.lang.StringtoString(java.lang.Object obj)If theobjis an array, toString() method ofArraysis called.
-
-
-
Method Detail
-
hashCode
public static int hashCode(java.lang.Object obj)
Returns a hash code forobj.- Parameters:
obj- The object to get a hash code for. May be an array ornull.- Returns:
- A hash code of
objor 0 ifobjisnull
-
equals
public static boolean equals(java.lang.Object thisObj, java.lang.Object thatObj)Compares two objects. ReturnstrueifthisObjandthatObjare bothnullthisObjandthatObjare instances of the same type andObject.equals(Object)returnstruethisObjandthatObjare arrays with the same component type and equals() method ofArraysreturnstrue(not deepEquals())
- Parameters:
thisObj- The left hand object to compare. May be an array ornullthatObj- The right hand object to compare. May be an array ornull- Returns:
trueif two objects are equal;falseotherwise.
-
toString
public static java.lang.String toString(java.lang.Object obj)
If theobjis an array, toString() method ofArraysis called. OtherwiseObject.toString()is called. Returns "null" ifobjisnull.- Parameters:
obj- An object. May be an array ornull.- Returns:
- String representation of the
obj.
-
-