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

package incheon.res.rdm.com.levy.stub;

public class DefaultMessage implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	private byte[] body;

    private byte[] header;

    public DefaultMessage() {
    }

    public DefaultMessage(
           byte[] body,
           byte[] header) {
           this.body = body;
           this.header = header;
    }


    /**
     * Gets the body value for this DefaultMessage.
     *
     * @return body
     */
    public byte[] getBody() {
    	byte[] ret = null; 
		if ( this.body != null ) {
			
			ret = new byte[body.length]; 
			for (int i = 0; i < body.length; i++) { 
				ret[i] = this.body[i]; 
			} 
		} 
		return ret;
    }


    /**
     * Sets the body value for this DefaultMessage.
     *
     * @param body
     */
    public void setBody(byte[] body) {
    	this.body = new byte[body.length];
		
		for (int i = 0; i < body.length; i++) {
			this.body[i] = body[i];
		}
    }


    /**
     * Gets the header value for this DefaultMessage.
     *
     * @return header
     */
    public byte[] getHeader() {
    	byte[] ret = null; 
		if ( this.header != null ) {
			
			ret = new byte[header.length]; 
			for (int i = 0; i < header.length; i++) { 
				ret[i] = this.header[i]; 
			} 
		} 
		return ret;
    }


    /**
     * Sets the header value for this DefaultMessage.
     *
     * @param header
     */
    public void setHeader(byte[] header) {
    	this.header = new byte[header.length];
		
		for (int i = 0; i < header.length; i++) {
			this.header[i] = header[i];
		}
    }

    private Object __equalsCalc = null;
    public synchronized boolean equals(Object obj) {
    	if (obj != null) {
    		if (!(obj instanceof DefaultMessage)) return false;
    		DefaultMessage other = (DefaultMessage) obj;
    		if (obj == null) return false;
    		if (this == obj) return true;
    		if (__equalsCalc != null) {
    			return (__equalsCalc == obj);
    		}
    		__equalsCalc = obj;
    		boolean _equals;
    		_equals = true &&
    				((this.body==null && other.getBody()==null) ||
    						(this.body!=null &&
    						java.util.Arrays.equals(this.body, other.getBody()))) &&
    						((this.header==null && other.getHeader()==null) ||
    								(this.header!=null &&
    								java.util.Arrays.equals(this.header, other.getHeader())));
    		__equalsCalc = null;
    		return _equals;
		} else {
			return false;
		}
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getBody() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getBody());
                 i++) {
                Object obj = java.lang.reflect.Array.get(getBody(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getHeader() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getHeader());
                 i++) {
                Object obj = java.lang.reflect.Array.get(getHeader(), 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(DefaultMessage.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://message.remote.fw.common.jcf", "DefaultMessage"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("body");
        elemField.setXmlName(new javax.xml.namespace.QName("", "body"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "base64Binary"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("header");
        elemField.setXmlName(new javax.xml.namespace.QName("", "header"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "base64Binary"));
        elemField.setNillable(true);
        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(
           String mechType,
           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(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}
