Package com.xxl.tool.core
Class ObjectTool
java.lang.Object
com.xxl.tool.core.ObjectTool
Object Tool
- Author:
- xuxueli 2024-01-21 05:03:10
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanDetermines whether two possibly-null objects are equal.static StringReturn a hex String form of an object's identity hash code.static StringidentityToString(Object obj) Return a String representation of the specified Object's identity.static booleanDetermines whether the given object is an array.static booleanDetermine whether the given array is empty:static StringReturn a String representation of the specified Object.static StringReturn a String representation of the contents of the specified array.
-
Constructor Details
-
ObjectTool
public ObjectTool()
-
-
Method Details
-
equal
Determines whether two possibly-null objects are equal. Returns:trueifaandbare both null.trueifaandbare both non-null and they are equal according toObject.equals(Object).falsein all other situations.
- Parameters:
a-b-- Returns:
-
isArray
Determines whether the given object is an array.- Parameters:
obj- the obj is null- Returns:
-
isEmpty
Determine whether the given array is empty:- Parameters:
array- the array to check
-
toString
Return a String representation of the specified Object.- Parameters:
obj- the object to build a String representation for- Returns:
- a String representation of
obj; Returns a"null"String ifobjisnull.
-
toString
Return a String representation of the contents of the specified array.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
identityToString
Return a String representation of the specified Object's identity.- Parameters:
obj- the object to build a String representation for- Returns:
- the object's identity string, like "com.xxx.xxx.XxxClass@1111"
-
getIdentityHexString
Return a hex String form of an object's identity hash code.- Parameters:
obj- the object- Returns:
- the object's identity code in hex notation
-