com.ibm.commerce.giftregistry.util

Class NullObject

  • java.lang.Object
    • com.ibm.commerce.giftregistry.util.NullObject


  • public class NullObject
    extends java.lang.Object
    A NullObject enables a user to treat an object as null value.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The IBM Copyright notice field.
      static NullObject VALUE
      An instance of NullObject.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj)
      Determines if an object is a NullObject.
      int hashCode() 
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM Copyright notice field.
        See Also:
        Constant Field Values
      • VALUE

        public static NullObject VALUE
        An instance of NullObject. Since NullObject means null, this object is immutable. One single instance can be used in more than one places simultaneously.
    • Method Detail

      • equals

        public boolean equals(java.lang.Object obj)
        Determines if an object is a NullObject.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to be examined
        Returns:
        true if the given object is also a NullObject. Otherwise, false.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code of NullObject. Any NullObject should have the same has code.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of null object