package com.amazonaws.a2s.model;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;


/**
 <p>Java class for anonymous complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 * &lt;complexType>
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="LowestNewPrice" type="{http://webservices.amazon.com/AWSECommerceService/2007-10-29}Price" minOccurs="0"/>
 *         &lt;element name="LowestUsedPrice" type="{http://webservices.amazon.com/AWSECommerceService/2007-10-29}Price" minOccurs="0"/>
 *         &lt;element name="LowestCollectiblePrice" type="{http://webservices.amazon.com/AWSECommerceService/2007-10-29}Price" minOccurs="0"/>
 *         &lt;element name="LowestRefurbishedPrice" type="{http://webservices.amazon.com/AWSECommerceService/2007-10-29}Price" minOccurs="0"/>
 *         &lt;element name="TotalNew" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="TotalUsed" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="TotalCollectible" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="TotalRefurbished" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 </pre>
 * Generated by AWS Code Generator
 <p/>
 * Thu Jan 10 05:27:59 PST 2008
 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "lowestNewPrice",
    "lowestUsedPrice",
    "lowestCollectiblePrice",
    "lowestRefurbishedPrice",
    "totalNew",
    "totalUsed",
    "totalCollectible",
    "totalRefurbished"
})
@XmlRootElement(name = "OfferSummary")
public class OfferSummary {

    @XmlElement(name = "LowestNewPrice")
    protected Price lowestNewPrice;
    @XmlElement(name = "LowestUsedPrice")
    protected Price lowestUsedPrice;
    @XmlElement(name = "LowestCollectiblePrice")
    protected Price lowestCollectiblePrice;
    @XmlElement(name = "LowestRefurbishedPrice")
    protected Price lowestRefurbishedPrice;
    @XmlElement(name = "TotalNew")
    protected String totalNew;
    @XmlElement(name = "TotalUsed")
    protected String totalUsed;
    @XmlElement(name = "TotalCollectible")
    protected String totalCollectible;
    @XmlElement(name = "TotalRefurbished")
    protected String totalRefurbished;

    /**
     * Gets the value of the lowestNewPrice property.
     
     @return
     *     possible object is
     *     {@link Price }
     *     
     */
    public Price getLowestNewPrice() {
        return lowestNewPrice;
    }

    /**
     * Sets the value of the lowestNewPrice property.
     
     @param value
     *     allowed object is
     *     {@link Price }
     *     
     */
    public void setLowestNewPrice(Price value) {
        this.lowestNewPrice = value;
    }

    public boolean isSetLowestNewPrice() {
        return (this.lowestNewPrice!= null);
    }

    /**
     * Gets the value of the lowestUsedPrice property.
     
     @return
     *     possible object is
     *     {@link Price }
     *     
     */
    public Price getLowestUsedPrice() {
        return lowestUsedPrice;
    }

    /**
     * Sets the value of the lowestUsedPrice property.
     
     @param value
     *     allowed object is
     *     {@link Price }
     *     
     */
    public void setLowestUsedPrice(Price value) {
        this.lowestUsedPrice = value;
    }

    public boolean isSetLowestUsedPrice() {
        return (this.lowestUsedPrice!= null);
    }

    /**
     * Gets the value of the lowestCollectiblePrice property.
     
     @return
     *     possible object is
     *     {@link Price }
     *     
     */
    public Price getLowestCollectiblePrice() {
        return lowestCollectiblePrice;
    }

    /**
     * Sets the value of the lowestCollectiblePrice property.
     
     @param value
     *     allowed object is
     *     {@link Price }
     *     
     */
    public void setLowestCollectiblePrice(Price value) {
        this.lowestCollectiblePrice = value;
    }

    public boolean isSetLowestCollectiblePrice() {
        return (this.lowestCollectiblePrice!= null);
    }

    /**
     * Gets the value of the lowestRefurbishedPrice property.
     
     @return
     *     possible object is
     *     {@link Price }
     *     
     */
    public Price getLowestRefurbishedPrice() {
        return lowestRefurbishedPrice;
    }

    /**
     * Sets the value of the lowestRefurbishedPrice property.
     
     @param value
     *     allowed object is
     *     {@link Price }
     *     
     */
    public void setLowestRefurbishedPrice(Price value) {
        this.lowestRefurbishedPrice = value;
    }

    public boolean isSetLowestRefurbishedPrice() {
        return (this.lowestRefurbishedPrice!= null);
    }

    /**
     * Gets the value of the totalNew property.
     
     @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getTotalNew() {
        return totalNew;
    }

    /**
     * Sets the value of the totalNew property.
     
     @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setTotalNew(String value) {
        this.totalNew = value;
    }

    public boolean isSetTotalNew() {
        return (this.totalNew!= null);
    }

    /**
     * Gets the value of the totalUsed property.
     
     @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getTotalUsed() {
        return totalUsed;
    }

    /**
     * Sets the value of the totalUsed property.
     
     @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setTotalUsed(String value) {
        this.totalUsed = value;
    }

    public boolean isSetTotalUsed() {
        return (this.totalUsed!= null);
    }

    /**
     * Gets the value of the totalCollectible property.
     
     @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getTotalCollectible() {
        return totalCollectible;
    }

    /**
     * Sets the value of the totalCollectible property.
     
     @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setTotalCollectible(String value) {
        this.totalCollectible = value;
    }

    public boolean isSetTotalCollectible() {
        return (this.totalCollectible!= null);
    }

    /**
     * Gets the value of the totalRefurbished property.
     
     @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getTotalRefurbished() {
        return totalRefurbished;
    }

    /**
     * Sets the value of the totalRefurbished property.
     
     @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setTotalRefurbished(String value) {
        this.totalRefurbished = value;
    }

    public boolean isSetTotalRefurbished() {
        return (this.totalRefurbished!= null);
    }

    /**
     * Sets the value of the LowestNewPrice property.
     
     @param value
     @return
     *     this instance
     */
    public OfferSummary withLowestNewPrice(Price value) {
        setLowestNewPrice(value);
        return this;
    }

    /**
     * Sets the value of the LowestUsedPrice property.
     
     @param value
     @return
     *     this instance
     */
    public OfferSummary withLowestUsedPrice(Price value) {
        setLowestUsedPrice(value);
        return this;
    }

    /**
     * Sets the value of the LowestCollectiblePrice property.
     
     @param value
     @return
     *     this instance
     */
    public OfferSummary withLowestCollectiblePrice(Price value) {
        setLowestCollectiblePrice(value);
        return this;
    }

    /**
     * Sets the value of the LowestRefurbishedPrice property.
     
     @param value
     @return
     *     this instance
     */
    public OfferSummary withLowestRefurbishedPrice(Price value) {
        setLowestRefurbishedPrice(value);
        return this;
    }

    /**
     * Sets the value of the TotalNew property.
     
     @param value
     @return
     *     this instance
     */
    public OfferSummary withTotalNew(String value) {
        setTotalNew(value);
        return this;
    }

    /**
     * Sets the value of the TotalUsed property.
     
     @param value
     @return
     *     this instance
     */
    public OfferSummary withTotalUsed(String value) {
        setTotalUsed(value);
        return this;
    }

    /**
     * Sets the value of the TotalCollectible property.
     
     @param value
     @return
     *     this instance
     */
    public OfferSummary withTotalCollectible(String value) {
        setTotalCollectible(value);
        return this;
    }

    /**
     * Sets the value of the TotalRefurbished property.
     
     @param value
     @return
     *     this instance
     */
    public OfferSummary withTotalRefurbished(String value) {
        setTotalRefurbished(value);
        return this;
    }
    

    /**
     
     * XML fragment representation of this object
     
     @return XML fragment for this object. Name for outer
     * tag expected to be set by calling method. This fragment
     * returns inner properties representation only
     */
    protected String toXMLFragment() {
        StringBuffer xml = new StringBuffer();
        if (isSetLowestNewPrice()) {
            Price  lowestNewPrice = getLowestNewPrice();
            xml.append("<LowestNewPrice>");
            xml.append(lowestNewPrice.toXMLFragment());
            xml.append("</LowestNewPrice>");
        
        if (isSetLowestUsedPrice()) {
            Price  lowestUsedPrice = getLowestUsedPrice();
            xml.append("<LowestUsedPrice>");
            xml.append(lowestUsedPrice.toXMLFragment());
            xml.append("</LowestUsedPrice>");
        
        if (isSetLowestCollectiblePrice()) {
            Price  lowestCollectiblePrice = getLowestCollectiblePrice();
            xml.append("<LowestCollectiblePrice>");
            xml.append(lowestCollectiblePrice.toXMLFragment());
            xml.append("</LowestCollectiblePrice>");
        
        if (isSetLowestRefurbishedPrice()) {
            Price  lowestRefurbishedPrice = getLowestRefurbishedPrice();
            xml.append("<LowestRefurbishedPrice>");
            xml.append(lowestRefurbishedPrice.toXMLFragment());
            xml.append("</LowestRefurbishedPrice>");
        
        if (isSetTotalNew()) {
            xml.append("<TotalNew>");
            xml.append(escapeXML(getTotalNew()));
            xml.append("</TotalNew>");
        }
        if (isSetTotalUsed()) {
            xml.append("<TotalUsed>");
            xml.append(escapeXML(getTotalUsed()));
            xml.append("</TotalUsed>");
        }
        if (isSetTotalCollectible()) {
            xml.append("<TotalCollectible>");
            xml.append(escapeXML(getTotalCollectible()));
            xml.append("</TotalCollectible>");
        }
        if (isSetTotalRefurbished()) {
            xml.append("<TotalRefurbished>");
            xml.append(escapeXML(getTotalRefurbished()));
            xml.append("</TotalRefurbished>");
        }
        return xml.toString();
    }

    /**
     
     * Escape XML special characters
     */
    private String escapeXML(String string) {
        StringBuffer sb = new StringBuffer();
        int length = string.length();
        for (int i = 0; i < length; ++i) {
            char c = string.charAt(i);
            switch (c) {
            case '&':
                sb.append("&amp;");
                break;
            case '<':
                sb.append("&lt;");
                break;
            case '>':
                sb.append("&gt;");
                break;
            case '\'':
                sb.append("&#039;");
                break;
            case '"':
                sb.append("&quot;");
                break;
            default:
                sb.append(c);
            }
        }
        return sb.toString();
    }


}