/**
 * Package2.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 Package2  extends com.adsionline.ADSIShippingWS._package  implements java.io.Serializable {
    private com.adsionline.ADSIShippingWS.NameValuePair[] additionalFields;

    public Package2() {
    }

    public Package2(
           java.lang.String ID,
           double weight,
           java.lang.String dimension,
           java.lang.String trackingNumber,
           java.lang.String description,
           java.lang.String commodityClass,
           boolean oversizeFlag,
           double oversizeFee,
           boolean declaredValueFlag,
           double declaredValueAmount,
           double declaredValueCustoms,
           java.lang.String billOfLadingComment,
           boolean hazmatFlag,
           boolean additionalHandlingFlag,
           double additionalHandlingFee,
           com.adsionline.ADSIShippingWS.EnumPackageType packaging,
           boolean CODFlag,
           double CODAmount,
           int CODPaymentType,
           com.adsionline.ADSIShippingWS.Address CODReturnAddress,
           com.adsionline.ADSIShippingWS.PackageCustomFields customFields,
           com.adsionline.ADSIShippingWS.IDangerousGoods[] dangerousGoods,
           com.adsionline.ADSIShippingWS.CommodityInfo[] commodityInfos,
           com.adsionline.ADSIShippingWS.NameValuePair[] additionalFields) {
        super(
            ID,
            weight,
            dimension,
            trackingNumber,
            description,
            commodityClass,
            oversizeFlag,
            oversizeFee,
            declaredValueFlag,
            declaredValueAmount,
            declaredValueCustoms,
            billOfLadingComment,
            hazmatFlag,
            additionalHandlingFlag,
            additionalHandlingFee,
            packaging,
            CODFlag,
            CODAmount,
            CODPaymentType,
            CODReturnAddress,
            customFields,
            dangerousGoods,
            commodityInfos);
        this.additionalFields = additionalFields;
    }


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


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

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof Package2)) return false;
        Package2 other = (Package2) 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())));
        __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();
                }
            }
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

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

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://adsionline.com/ADSIShippingWS/", "Package2"));
        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);
    }

    /**
     * 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);
    }

}
