package com.amazonaws.a2s.model;

import java.math.BigInteger;
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.XmlSchemaType;
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="TotalExcerpts" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" minOccurs="0"/>
 *         &lt;element name="Excerpt" type="{http://webservices.amazon.com/AWSECommerceService/2007-10-29}SearchInsideExcerpt" 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 = {
    "totalExcerpts",
    "excerpt"
})
@XmlRootElement(name = "SearchInside")
public class SearchInside {

    @XmlElement(name = "TotalExcerpts")
    @XmlSchemaType(name = "nonNegativeInteger")
    protected BigInteger totalExcerpts;
    @XmlElement(name = "Excerpt")
    protected SearchInsideExcerpt excerpt;

    /**
     * Gets the value of the totalExcerpts property.
     
     @return
     *     possible object is
     *     {@link BigInteger }
     *     
     */
    public BigInteger getTotalExcerpts() {
        return totalExcerpts;
    }

    /**
     * Sets the value of the totalExcerpts property.
     
     @param value
     *     allowed object is
     *     {@link BigInteger }
     *     
     */
    public void setTotalExcerpts(BigInteger value) {
        this.totalExcerpts = value;
    }

    public boolean isSetTotalExcerpts() {
        return (this.totalExcerpts!= null);
    }

    /**
     * Gets the value of the excerpt property.
     
     @return
     *     possible object is
     *     {@link SearchInsideExcerpt }
     *     
     */
    public SearchInsideExcerpt getExcerpt() {
        return excerpt;
    }

    /**
     * Sets the value of the excerpt property.
     
     @param value
     *     allowed object is
     *     {@link SearchInsideExcerpt }
     *     
     */
    public void setExcerpt(SearchInsideExcerpt value) {
        this.excerpt = value;
    }

    public boolean isSetExcerpt() {
        return (this.excerpt!= null);
    }

    /**
     * Sets the value of the TotalExcerpts property.
     
     @param value
     @return
     *     this instance
     */
    public SearchInside withTotalExcerpts(BigInteger value) {
        setTotalExcerpts(value);
        return this;
    }

    /**
     * Sets the value of the Excerpt property.
     
     @param value
     @return
     *     this instance
     */
    public SearchInside withExcerpt(SearchInsideExcerpt value) {
        setExcerpt(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 (isSetTotalExcerpts()) {
            xml.append("<TotalExcerpts>");
            xml.append(getTotalExcerpts() "");
            xml.append("</TotalExcerpts>");
        }
        if (isSetExcerpt()) {
            SearchInsideExcerpt  excerpt = getExcerpt();
            xml.append("<Excerpt>");
            xml.append(excerpt.toXMLFragment());
            xml.append("</Excerpt>");
        
        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();
    }


}