/**
 * KeyValue.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.genesyslab.gis.services.statistic.types;

public class KeyValue  implements java.io.Serializable {
    private byte[] binaryValue;

    private int intValue;

    private java.lang.String key;

    private com.genesyslab.gis.services.statistic.types.KeyValue[] kvListValue;

    private java.lang.String stringValue;

    public KeyValue() {
    }

    public KeyValue(
           byte[] binaryValue,
           int intValue,
           java.lang.String key,
           com.genesyslab.gis.services.statistic.types.KeyValue[] kvListValue,
           java.lang.String stringValue) {
           this.binaryValue = binaryValue;
           this.intValue = intValue;
           this.key = key;
           this.kvListValue = kvListValue;
           this.stringValue = stringValue;
    }


    /**
     * Gets the binaryValue value for this KeyValue.
     * 
     * @return binaryValue
     */
    public byte[] getBinaryValue() {
        return binaryValue;
    }


    /**
     * Sets the binaryValue value for this KeyValue.
     * 
     * @param binaryValue
     */
    public void setBinaryValue(byte[] binaryValue) {
        this.binaryValue = binaryValue;
    }


    /**
     * Gets the intValue value for this KeyValue.
     * 
     * @return intValue
     */
    public int getIntValue() {
        return intValue;
    }


    /**
     * Sets the intValue value for this KeyValue.
     * 
     * @param intValue
     */
    public void setIntValue(int intValue) {
        this.intValue = intValue;
    }


    /**
     * Gets the key value for this KeyValue.
     * 
     * @return key
     */
    public java.lang.String getKey() {
        return key;
    }


    /**
     * Sets the key value for this KeyValue.
     * 
     * @param key
     */
    public void setKey(java.lang.String key) {
        this.key = key;
    }


    /**
     * Gets the kvListValue value for this KeyValue.
     * 
     * @return kvListValue
     */
    public com.genesyslab.gis.services.statistic.types.KeyValue[] getKvListValue() {
        return kvListValue;
    }


    /**
     * Sets the kvListValue value for this KeyValue.
     * 
     * @param kvListValue
     */
    public void setKvListValue(com.genesyslab.gis.services.statistic.types.KeyValue[] kvListValue) {
        this.kvListValue = kvListValue;
    }


    /**
     * Gets the stringValue value for this KeyValue.
     * 
     * @return stringValue
     */
    public java.lang.String getStringValue() {
        return stringValue;
    }


    /**
     * Sets the stringValue value for this KeyValue.
     * 
     * @param stringValue
     */
    public void setStringValue(java.lang.String stringValue) {
        this.stringValue = stringValue;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof KeyValue)) return false;
        KeyValue other = (KeyValue) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true && 
            ((this.binaryValue==null && other.getBinaryValue()==null) || 
             (this.binaryValue!=null &&
              java.util.Arrays.equals(this.binaryValue, other.getBinaryValue()))) &&
            this.intValue == other.getIntValue() &&
            ((this.key==null && other.getKey()==null) || 
             (this.key!=null &&
              this.key.equals(other.getKey()))) &&
            ((this.kvListValue==null && other.getKvListValue()==null) || 
             (this.kvListValue!=null &&
              java.util.Arrays.equals(this.kvListValue, other.getKvListValue()))) &&
            ((this.stringValue==null && other.getStringValue()==null) || 
             (this.stringValue!=null &&
              this.stringValue.equals(other.getStringValue())));
        __equalsCalc = null;
        return _equals;
    }

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

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

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.genesyslab.com/services/statservice/types/2005/10", "keyValue"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("binaryValue");
        elemField.setXmlName(new javax.xml.namespace.QName("", "binaryValue"));
        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("intValue");
        elemField.setXmlName(new javax.xml.namespace.QName("", "intValue"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("key");
        elemField.setXmlName(new javax.xml.namespace.QName("", "key"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("kvListValue");
        elemField.setXmlName(new javax.xml.namespace.QName("", "kvListValue"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.genesyslab.com/services/statservice/types/2005/10", "keyValue"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("stringValue");
        elemField.setXmlName(new javax.xml.namespace.QName("", "stringValue"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        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(
           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);
    }

}
