/*
 * XML Type:  SequenceType
 * Namespace: http://schemas.xmlsoap.org/ws/2004/03/rm
 * Java type: org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceType
 *
 * Automatically generated - do not modify.
 */
package org.xmlsoap.schemas.ws.x2004.x03.rm.impl;

/**
 * An XML SequenceType(@http://schemas.xmlsoap.org/ws/2004/03/rm).
 * <p/>
 * This is a complex type.
 */
public class SequenceTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceType {

    public SequenceTypeImpl(org.apache.xmlbeans.SchemaType sType) {
        super(sType);
    }

    private static final javax.xml.namespace.QName IDENTIFIER$0 =
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2002/07/utility", "Identifier");
    private static final javax.xml.namespace.QName MESSAGENUMBER$2 =
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/03/rm", "MessageNumber");
    private static final javax.xml.namespace.QName LASTMESSAGE$4 =
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/03/rm", "LastMessage");


    /**
     * Gets the "Identifier" element
     */
    public org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI getIdentifier() {
        synchronized (monitor()) {
            check_orphaned();
            org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI target = null;
            target = (org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI) get_store().find_element_user(IDENTIFIER$0, 0);
            if (target == null) {
                return null;
            }
            return target;
        }
    }

    /**
     * Sets the "Identifier" element
     */
    public void setIdentifier(org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI identifier) {
        synchronized (monitor()) {
            check_orphaned();
            org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI target = null;
            target = (org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI) get_store().find_element_user(IDENTIFIER$0, 0);
            if (target == null) {
                target = (org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI) get_store().add_element_user(IDENTIFIER$0);
            }
            target.set(identifier);
        }
    }

    /**
     * Appends and returns a new empty "Identifier" element
     */
    public org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI addNewIdentifier() {
        synchronized (monitor()) {
            check_orphaned();
            org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI target = null;
            target = (org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI) get_store().add_element_user(IDENTIFIER$0);
            return target;
        }
    }

    /**
     * Gets the "MessageNumber" element
     */
    public java.math.BigInteger getMessageNumber() {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue) get_store().find_element_user(MESSAGENUMBER$2, 0);
            if (target == null) {
                return null;
            }
            return target.getBigIntegerValue();
        }
    }

    /**
     * Gets (as xml) the "MessageNumber" element
     */
    public org.apache.xmlbeans.XmlUnsignedLong xgetMessageNumber() {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.XmlUnsignedLong target = null;
            target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().find_element_user(MESSAGENUMBER$2, 0);
            return target;
        }
    }

    /**
     * Sets the "MessageNumber" element
     */
    public void setMessageNumber(java.math.BigInteger messageNumber) {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue) get_store().find_element_user(MESSAGENUMBER$2, 0);
            if (target == null) {
                target = (org.apache.xmlbeans.SimpleValue) get_store().add_element_user(MESSAGENUMBER$2);
            }
            target.setBigIntegerValue(messageNumber);
        }
    }

    /**
     * Sets (as xml) the "MessageNumber" element
     */
    public void xsetMessageNumber(org.apache.xmlbeans.XmlUnsignedLong messageNumber) {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.XmlUnsignedLong target = null;
            target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().find_element_user(MESSAGENUMBER$2, 0);
            if (target == null) {
                target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().add_element_user(MESSAGENUMBER$2);
            }
            target.set(messageNumber);
        }
    }

    /**
     * Gets the "LastMessage" element
     */
    public org.apache.xmlbeans.XmlObject getLastMessage() {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.XmlObject target = null;
            target = (org.apache.xmlbeans.XmlObject) get_store().find_element_user(LASTMESSAGE$4, 0);
            if (target == null) {
                return null;
            }
            return target;
        }
    }

    /**
     * True if has "LastMessage" element
     */
    public boolean isSetLastMessage() {
        synchronized (monitor()) {
            check_orphaned();
            return get_store().count_elements(LASTMESSAGE$4) != 0;
        }
    }

    /**
     * Sets the "LastMessage" element
     */
    public void setLastMessage(org.apache.xmlbeans.XmlObject lastMessage) {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.XmlObject target = null;
            target = (org.apache.xmlbeans.XmlObject) get_store().find_element_user(LASTMESSAGE$4, 0);
            if (target == null) {
                target = (org.apache.xmlbeans.XmlObject) get_store().add_element_user(LASTMESSAGE$4);
            }
            target.set(lastMessage);
        }
    }

    /**
     * Appends and returns a new empty "LastMessage" element
     */
    public org.apache.xmlbeans.XmlObject addNewLastMessage() {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.XmlObject target = null;
            target = (org.apache.xmlbeans.XmlObject) get_store().add_element_user(LASTMESSAGE$4);
            return target;
        }
    }

    /**
     * Unsets the "LastMessage" element
     */
    public void unsetLastMessage() {
        synchronized (monitor()) {
            check_orphaned();
            get_store().remove_element(LASTMESSAGE$4, 0);
        }
    }
}
