/**
 * Shipment2.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package com.adsionline.ADSIShippingWS;

public class Shipment2  extends com.adsionline.ADSIShippingWS.Shipment  implements java.io.Serializable {
    private com.adsionline.ADSIShippingWS.NameValuePair[] additionalFields;

    private com.adsionline.ADSIShippingWS.Package2[] packages2;

    public Shipment2() {
    }

    public Shipment2(
           java.lang.String ID,
           com.adsionline.ADSIShippingWS.Address recipient,
           com.adsionline.ADSIShippingWS.Service service,
           java.lang.String serviceName,
           com.adsionline.ADSIShippingWS.EnumTerms terms,
           boolean residentialFlag,
           boolean proofOfDeliveryFlag,
           boolean signatureReleaseFlag,
           boolean signatureRequiredFlag,
           boolean saturdayDeliveryFlag,
           java.util.Calendar shipDate,
           java.lang.String consigneeAccount,
           boolean thirdPartyBillingFlag,
           java.lang.String thirdPartyBillingAccount,
           com.adsionline.ADSIShippingWS.Address thirdPartyBillingAddress,
           boolean HALFlag,
           com.adsionline.ADSIShippingWS.Address HALAddress,
           com.adsionline.ADSIShippingWS.EnumManifestAction manifestAction,
           java.lang.String shipperName,
           boolean consigneeBillingFlag,
           java.lang.String shipperReference,
           java.lang.String consigneeReference,
           java.lang.String carrierInstructions,
           java.lang.String ultimateDestinationCountry,
           com.adsionline.ADSIShippingWS.ShipmentCustomFields customFields,
           com.adsionline.ADSIShippingWS.EnumTimeInTransit timeInTransit,
           com.adsionline.ADSIShippingWS._package[] packages,
           com.adsionline.ADSIShippingWS.NameValuePair[] additionalFields,
           com.adsionline.ADSIShippingWS.Package2[] packages2) {
        super(
            ID,
            recipient,
            service,
            serviceName,
            terms,
            residentialFlag,
            proofOfDeliveryFlag,
            signatureReleaseFlag,
            signatureRequiredFlag,
            saturdayDeliveryFlag,
            shipDate,
            consigneeAccount,
            thirdPartyBillingFlag,
            thirdPartyBillingAccount,
            thirdPartyBillingAddress,
            HALFlag,
            HALAddress,
            manifestAction,
            shipperName,
            consigneeBillingFlag,
            shipperReference,
            consigneeReference,
            carrierInstructions,
            ultimateDestinationCountry,
            customFields,
            timeInTransit,
            packages);
        this.additionalFields = additionalFields;
        this.packages2 = packages2;
    }


    /**
     * Gets the additionalFields value for this Shipment2.
     * 
     * @return additionalFields
     */
    public com.adsionline.ADSIShippingWS.NameValuePair[] getAdditionalFields() {
        return additionalFields;
    }


    /**
     * Sets the additionalFields value for this Shipment2.
     * 
     * @param additionalFields
     */
    public void setAdditionalFields(com.adsionline.ADSIShippingWS.NameValuePair[] additionalFields) {
        this.additionalFields = additionalFields;
    }


    /**
     * Gets the packages2 value for this Shipment2.
     * 
     * @return packages2
     */
    public com.adsionline.ADSIShippingWS.Package2[] getPackages2() {
        return packages2;
    }


    /**
     * Sets the packages2 value for this Shipment2.
     * 
     * @param packages2
     */
    public void setPackages2(com.adsionline.ADSIShippingWS.Package2[] packages2) {
        this.packages2 = packages2;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof Shipment2)) return false;
        Shipment2 other = (Shipment2) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = super.equals(obj) && 
            ((this.additionalFields==null && other.getAdditionalFields()==null) || 
             (this.additionalFields!=null &&
              java.util.Arrays.equals(this.additionalFields, other.getAdditionalFields()))) &&
            ((this.packages2==null && other.getPackages2()==null) || 
             (this.packages2!=null &&
              java.util.Arrays.equals(this.packages2, other.getPackages2())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = super.hashCode();
        if (getAdditionalFields() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getAdditionalFields());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getAdditionalFields(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getPackages2() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getPackages2());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getPackages2(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(Shipment2.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://adsionline.com/ADSIShippingWS/", "Shipment2"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("additionalFields");
        elemField.setXmlName(new javax.xml.namespace.QName("http://adsionline.com/ADSIShippingWS/", "AdditionalFields"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://adsionline.com/ADSIShippingWS/", "NameValuePair"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setItemQName(new javax.xml.namespace.QName("http://adsionline.com/ADSIShippingWS/", "NameValuePair"));
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("packages2");
        elemField.setXmlName(new javax.xml.namespace.QName("http://adsionline.com/ADSIShippingWS/", "Packages2"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://adsionline.com/ADSIShippingWS/", "Package2"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setItemQName(new javax.xml.namespace.QName("http://adsionline.com/ADSIShippingWS/", "Package2"));
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType, 
           java.lang.Class _javaType,  
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType, 
           java.lang.Class _javaType,  
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}
