Interface IObjectUtil


public interface IObjectUtil
Define common Object operations
Since:
1.0.0
Version:
1.0.0
Author:
yui-KITAMURA
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object first, Object second)
    null-safe equality test.
    boolean
    Check the object is NOT null
    boolean
    Check the object is null
    boolean
    isTypeOf(Object instance, Class superClz)
    check the instance is extends or implements the class
  • Method Details

    • isNull

      @Contract("null -> true; !null -> false") boolean isNull(Object obj)
      Check the object is null
      Parameters:
      obj - check target instance or null value
      Returns:
      if the object is null then true
    • isNotNull

      @Contract("null -> false; !null -> true") boolean isNotNull(Object obj)
      Check the object is NOT null
      Parameters:
      obj - check target instance or null value
      Returns:
      if the object is NOT null then true
    • equals

      @Contract("null,null -> true; null,!null -> false; !null,null -> false; _,_ -> _") boolean equals(Object first, Object second)
      null-safe equality test. Almost same as first.equals(second), but safe to null.
      • null,null then true
      • null,NOT-null then false
      • NOT-null,null then false
      • NOT-null,NOT-null then same to Object.equals(Object)
      Parameters:
      first - first object
      second - 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 checked
      superClz - expected super class or interface
      Returns:
      if the instance are the child of superClz then true
      See Also: