public interface IObjectUtil
Define common Object operations
- Since:
- 1.0.0
- Version:
- 1.0.0
- Author:
- yui-KITAMURA
-
Method Summary
Modifier and TypeMethodDescriptionbooleannull-safe equality test.booleanCheck the object is NOTnullbooleanCheck the object isnullbooleancheck 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
nullthentrue
-
isNotNull
Check the object is NOTnull- Parameters:
obj- check target instance or null value- Returns:
- if the object is NOT
nullthentrue
-
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,nullthentruenull,NOT-nullthenfalseNOT-null,nullthenfalseNOT-null,NOT-nullthen 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:
-