com.ibm.commerce.marketing.promotion.choice.gift

Class FreeGiftSpecification

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.choice.gift.FreeGiftSpecification
  • All Implemented Interfaces:
    RewardSpecification, XMLizable, java.io.Serializable


    public class FreeGiftSpecification
    extends java.lang.Object
    implements RewardSpecification
    This class implements RewardSpecification interface and it defines the free gift item selections for a shopper to choice. XML Snippet for this RewardSpecification:
     <p>
     <RewardSpecification impl="com.ibm.commerce.marketing.promotion.choice.gift.FreeGiftSpecification">
            <MaxQuantity>3</MaxQuantity>
            <GiftItem impl="com.ibm.commerce.marketing.promotion.choice.gift.CatalogEntryGiftItem">
                    <Quantity>3</Quantity>
                    <CatalogEntryKey>
                            <SKU>SKU-20101099</SKU>
                            <DN>o=Root Organization</DN>        
                    </CatalogEntryKey>        
            </GiftItem>
     </RewardSpecification>
     </p>
     
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void fromXML(org.w3c.dom.Node anXMLNode)
      Transforms the XML node into its corresponding real Object.
      java.util.List getGiftItems()
      Returns a list of GiftItem objects.
      java.lang.Integer getMaxQuantity()
      Gets the allowed maximum quantity of gift items.
      void setMaxQuantity(java.lang.Integer maxQuantity)
      Sets the allowed maximum quantity of gift items.
      java.lang.String toXML()
      Please note that this implementation will cache the result XML after first call to this method.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String TAG_MAX_QUANTITY
        XML tag - MaxQuantity
        See Also:
        Constant Field Values
    • Constructor Detail

      • FreeGiftSpecification

        public FreeGiftSpecification()
    • Method Detail

      • getGiftItems

        public java.util.List getGiftItems()
        Returns a list of GiftItem objects.
        Returns:
        A list of GiftItem objects.
      • toXML

        public java.lang.String toXML()
                               throws XMLizationException
        Please note that this implementation will cache the result XML after first call to this method. It is expected that contents of this object should not be changed once this method is called. Create a new instance if change is required.
        Specified by:
        toXML in interface XMLizable
        Returns:
        The string format of the XML that represents this XMLizable object
        Throws:
        XMLizationException - when this process fails
        See Also:
        XMLizable.toXML()
      • getMaxQuantity

        public java.lang.Integer getMaxQuantity()
        Gets the allowed maximum quantity of gift items. If the value is not specified, it will return 1.
        Returns:
        The maximum quantity.
      • setMaxQuantity

        public void setMaxQuantity(java.lang.Integer maxQuantity)
        Sets the allowed maximum quantity of gift items.
        Parameters:
        maxQuantity - The quantity to set.