com.ibm.commerce.marketing.promotion.dependency

Class CustomerKey

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.dependency.CustomerKey
  • All Implemented Interfaces:
    Key, NumericKey, XMLizable, java.io.Serializable


    public class CustomerKey
    extends java.lang.Object
    implements NumericKey, XMLizable
    The key to represent a shopper or a customer.

    XML Snippets for CustomerKey:

         <CustomerKey>
            <MemberID>1234</MemberID>
         </CustomerKey>
     
    OR
          <CustomerKey>
            <GuestToken>token1</GuestToken>
          </CustomerKey>
     
    OR
         <CustomerKey>
            <LogonId>wcsadmin</LogonId>
         </CustomerKey>
     
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CustomerKey()
      Constructor for CustomerKey.
      CustomerKey(java.lang.String logonId)
      Constructor for CustomerKey.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj)
      Returns true if this Customer key equals to another Customer key.
      void fromXML(org.w3c.dom.Node node)
      Transforms the XML node into its corresponding real Object.
      java.lang.String getGuestToken()
      Gets a guest token if it has been assigned to a guest shopper.
      java.lang.String getLogonID()
      Returns the logon id of customer key.
      java.lang.Long getMemberId()
      Returns the member id associated with customer key.
      java.lang.Number getNumericKey()
      Returns the numeric key of the customer key.
      int hashCode()
      Returns the hashcode of the Customer key.
      boolean identifiesAGuestShopper()
      Checks to see if this Customer Key points to a guest shopper or not.
      boolean isNumericKeySet()
      Checks if numeric key is set or not.
      void setGuestToken(java.lang.String string)
      Sets a guest token for a guest shopper
      void setLogonID(java.lang.String aLogonID)
      Sets the logon id of customer key.
      void setNumericKey(java.lang.Number numericKey)
      Sets the numeric key.
      java.lang.String toString()
      Give a String presentation of this Customer Key.
      java.lang.String toXML()
      Converts the object into its corresponding XML format representation.
      • Methods inherited from class java.lang.Object

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

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CustomerKey

        public CustomerKey(java.lang.String logonId)
        Constructor for CustomerKey.
        Parameters:
        logonId - java.lang.String is the login id.
      • CustomerKey

        public CustomerKey()
        Constructor for CustomerKey.
    • Method Detail

      • getNumericKey

        public java.lang.Number getNumericKey()
        Returns the numeric key of the customer key.
        Specified by:
        getNumericKey in interface NumericKey
        Returns:
        Number the numeric key of the customer key.
      • isNumericKeySet

        public boolean isNumericKeySet()
        Checks if numeric key is set or not.
        Specified by:
        isNumericKeySet in interface NumericKey
        Returns:
        boolean true if key is set; false otherwise.
      • setNumericKey

        public void setNumericKey(java.lang.Number numericKey)
        Sets the numeric key.
        Parameters:
        numericKey - The numeric key to set
      • getMemberId

        public java.lang.Long getMemberId()
        Returns the member id associated with customer key.
        Returns:
        Long memberId associated with customer key.
      • toString

        public java.lang.String toString()
        Give a String presentation of this Customer Key.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representing this Customer Key in string format.
      • equals

        public boolean equals(java.lang.Object obj)
        Returns true if this Customer key equals to another Customer key.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - java.lang.Object is another customer key.
        Returns:
        boolean true if keys are equal; false otherwise.
      • hashCode

        public int hashCode()
        Returns the hashcode of the Customer key.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashcode of the Customer key.
      • getLogonID

        public java.lang.String getLogonID()
        Returns the logon id of customer key.
        Returns:
        String the logon id of customer key.
      • setLogonID

        public void setLogonID(java.lang.String aLogonID)
        Sets the logon id of customer key.
        Parameters:
        aLogonID - The logon id of customer key to set.
      • getGuestToken

        public java.lang.String getGuestToken()
        Gets a guest token if it has been assigned to a guest shopper.
        Returns:
        String representing a guest token.
      • setGuestToken

        public void setGuestToken(java.lang.String string)
        Sets a guest token for a guest shopper
        Parameters:
        string - The GuestToken.
      • identifiesAGuestShopper

        public boolean identifiesAGuestShopper()
        Checks to see if this Customer Key points to a guest shopper or not.
        Returns:
        true when the shopper identified by this key is a guest shopper, false otherwise.