/*
 * XML Type:  PortReferenceType
 * Namespace: http://schemas.xmlsoap.org/ws/2002/07/utility
 * Java type: org.xmlsoap.schemas.ws.x2002.x07.utility.PortReferenceType
 *
 * Automatically generated - do not modify.
 */
package org.xmlsoap.schemas.ws.x2002.x07.utility.impl;

/**
 * An XML PortReferenceType(@http://schemas.xmlsoap.org/ws/2002/07/utility).
 * <p/>
 * This is a complex type.
 */
public class PortReferenceTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.xmlsoap.schemas.ws.x2002.x07.utility.PortReferenceType {

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

    private static final javax.xml.namespace.QName ADDRESS$0 =
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2002/07/utility", "Address");
    private static final javax.xml.namespace.QName ID$2 =
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2002/07/utility", "Id");


    /**
     * Gets the "Address" element
     */
    public org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI getAddress() {
        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(ADDRESS$0, 0);
            if (target == null) {
                return null;
            }
            return target;
        }
    }

    /**
     * Sets the "Address" element
     */
    public void setAddress(org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI address) {
        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(ADDRESS$0, 0);
            if (target == null) {
                target = (org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI) get_store().add_element_user(ADDRESS$0);
            }
            target.set(address);
        }
    }

    /**
     * Appends and returns a new empty "Address" element
     */
    public org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI addNewAddress() {
        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(ADDRESS$0);
            return target;
        }
    }

    /**
     * Gets the "Id" attribute
     */
    public java.lang.String getId() {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue) get_store().find_attribute_user(ID$2);
            if (target == null) {
                return null;
            }
            return target.getStringValue();
        }
    }

    /**
     * Gets (as xml) the "Id" attribute
     */
    public org.apache.xmlbeans.XmlID xgetId() {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.XmlID target = null;
            target = (org.apache.xmlbeans.XmlID) get_store().find_attribute_user(ID$2);
            return target;
        }
    }

    /**
     * True if has "Id" attribute
     */
    public boolean isSetId() {
        synchronized (monitor()) {
            check_orphaned();
            return get_store().find_attribute_user(ID$2) != null;
        }
    }

    /**
     * Sets the "Id" attribute
     */
    public void setId(java.lang.String id) {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue) get_store().find_attribute_user(ID$2);
            if (target == null) {
                target = (org.apache.xmlbeans.SimpleValue) get_store().add_attribute_user(ID$2);
            }
            target.setStringValue(id);
        }
    }

    /**
     * Sets (as xml) the "Id" attribute
     */
    public void xsetId(org.apache.xmlbeans.XmlID id) {
        synchronized (monitor()) {
            check_orphaned();
            org.apache.xmlbeans.XmlID target = null;
            target = (org.apache.xmlbeans.XmlID) get_store().find_attribute_user(ID$2);
            if (target == null) {
                target = (org.apache.xmlbeans.XmlID) get_store().add_attribute_user(ID$2);
            }
            target.set(id);
        }
    }

    /**
     * Unsets the "Id" attribute
     */
    public void unsetId() {
        synchronized (monitor()) {
            check_orphaned();
            get_store().remove_attribute(ID$2);
        }
    }
}
