public interface IObjectUtil
Define common Object operations
- Since:
- 1.0.0
- Version:
- 1.0.0
- Author:
- yui-KITAMURA
-
Method Summary
Modifier and TypeMethodDescriptionboolean
null-safe equality test.boolean
Check the object is NOTnull
boolean
Check the object isnull
boolean
check the instance is extends or implements the class
-
Method Details
-
isNull
Check the object isnull
- Parameters:
obj
- check target instance or null value- Returns:
- if the object is
null
thentrue
-
isNotNull
Check the object is NOTnull
- Parameters:
obj
- check target instance or null value- Returns:
- if the object is NOT
null
thentrue
-
equals
@Contract("null,null -> true; null,!null -> false; !null,null -> false; _,_ -> _") boolean equals(Object first, Object second) null-safe equality test. Almost same asfirst.equals(second)
, but safe to null.null,null
thentrue
null,NOT-null
thenfalse
NOT-null,null
thenfalse
NOT-null,NOT-null
then same toObject.equals(Object)
- Parameters:
first
- first objectsecond
- second object- Returns:
- almost same to
Object.equals(Object)
. See the document body
-
isTypeOf
@Contract("_,null -> fail; null,_ -> false; !null,!null -> _ ") boolean isTypeOf(Object instance, Class superClz) check the instance is extends or implements the class- Parameters:
instance
- instance that to be checkedsuperClz
- expected super class or interface- Returns:
- if the instance are the child of superClz then
true
- See Also:
-