@Override
  public int hashCode( Object object ) throws KettleValueException {
    int hash = 0;

    if ( isNull( object ) ) {
      switch ( getType() ) {
        case TYPE_BOOLEAN:
          hash ^= 1;
          break;
        case TYPE_DATE:
          hash ^= 2;
          break;
        case TYPE_NUMBER:
          hash ^= 4;
          break;
        case TYPE_STRING:
          hash ^= 8;
          break;
        case TYPE_INTEGER:
          hash ^= 16;
          break;
        case TYPE_BIGNUMBER:
          hash ^= 32;
          break;
        case TYPE_BINARY:
          hash ^= 64;
          break;
        case TYPE_TIMESTAMP:
          hash ^= 128;
          break;
        case TYPE_INET:
          hash ^= 256;
          break;
        case TYPE_NONE:
          break;
        default:
          break;
      }
    } else {
      switch ( getType() ) {
        case TYPE_BOOLEAN:
          hash ^= getBoolean( object ).hashCode();
          break;
        case TYPE_DATE:
          hash ^= getDate( object ).hashCode();
          break;
        case TYPE_INTEGER:
          hash ^= getInteger( object ).hashCode();
          break;
        case TYPE_NUMBER:
          hash ^= getNumber( object ).hashCode();
          break;
        case TYPE_STRING:
          hash ^= getString( object ).hashCode();
          break;
        case TYPE_BIGNUMBER:
          hash ^= getBigNumber( object ).hashCode();
          break;
        case TYPE_BINARY:
          hash ^= Arrays.hashCode( (byte[]) object );
          break;
        case TYPE_TIMESTAMP:
          hash ^= ((Timestamp) object ).hashCode();
          break;
        case TYPE_INET:
          hash ^= ((InetAddress) object ).hashCode();
          break;
        case TYPE_NONE:
          break;
        default:
          break;
      }
    }

    return hash;
  }
@Test
  public void testNullHashCodes() throws Exception {
    ValueMetaBase valueMetaString = new ValueMetaBase( );

    valueMetaString.type = ValueMetaInterface.TYPE_BOOLEAN;
    assertEquals( valueMetaString.hashCode( null ),  0 ^ 1 );

    valueMetaString.type = ValueMetaInterface.TYPE_DATE;
    assertEquals( valueMetaString.hashCode( null ),  0 ^ 2 );

    valueMetaString.type = ValueMetaInterface.TYPE_NUMBER;
    assertEquals( valueMetaString.hashCode( null ),  0 ^ 4 );

    valueMetaString.type = ValueMetaInterface.TYPE_STRING;
    assertEquals( valueMetaString.hashCode( null ),  0 ^ 8 );

    valueMetaString.type = ValueMetaInterface.TYPE_INTEGER;
    assertEquals( valueMetaString.hashCode( null ),  0 ^ 16 );

    valueMetaString.type = ValueMetaInterface.TYPE_BIGNUMBER;
    assertEquals( valueMetaString.hashCode( null ),  0 ^ 32 );

    valueMetaString.type = ValueMetaInterface.TYPE_BINARY;
    assertEquals( valueMetaString.hashCode( null ),  0 ^ 64 );

    valueMetaString.type = ValueMetaInterface.TYPE_TIMESTAMP;
    assertEquals( valueMetaString.hashCode( null ),  0 ^ 128 );

    valueMetaString.type = ValueMetaInterface.TYPE_INET;
    assertEquals( valueMetaString.hashCode( null ),  0 ^ 256 );

    valueMetaString.type = ValueMetaInterface.TYPE_NONE;
    assertEquals( valueMetaString.hashCode( null ),  0 );
  }