@Override
  public String getCompatibleString( Object object ) throws KettleValueException {
    try {
      String string;

      switch ( type ) {
        case TYPE_DATE:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              string = convertDateToCompatibleString( (Date) object );
              break;
            case STORAGE_TYPE_BINARY_STRING:
              string = convertDateToCompatibleString( (Date) convertBinaryStringToNativeType( (byte[]) object ) );
              break;
            case STORAGE_TYPE_INDEXED:
              if ( object == null ) {
                string = null;
              } else {
                string = convertDateToCompatibleString( (Date) index[( (Integer) object ).intValue()] );
              }
              break;
            default:
              throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
          break;

        case TYPE_NUMBER:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              string = convertNumberToCompatibleString( (Double) object );
              break;
            case STORAGE_TYPE_BINARY_STRING:
              string = convertNumberToCompatibleString( (Double) convertBinaryStringToNativeType( (byte[]) object ) );
              break;
            case STORAGE_TYPE_INDEXED:
              string =
                  object == null ? null : convertNumberToCompatibleString( (Double) index[( (Integer) object )
                      .intValue()] );
              break;
            default:
              throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
          break;

        case TYPE_INTEGER:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              string = convertIntegerToCompatibleString( (Long) object );
              break;
            case STORAGE_TYPE_BINARY_STRING:
              try {
                string = convertIntegerToCompatibleString( (Long) convertBinaryStringToNativeType( (byte[]) object ) );
              } catch ( ClassCastException e ) {
                string = convertIntegerToCompatibleString( (Long) object );
              }
              break;
            case STORAGE_TYPE_INDEXED:
              string =
                  object == null ? null : convertIntegerToCompatibleString( (Long) index[( (Integer) object )
                      .intValue()] );
              break;
            default:
              throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
          break;

        default:
          return getString( object );
      }

      return string;
    } catch ( ClassCastException e ) {
      throw new KettleValueException( toString() + " : There was a data type error: the data type of "
          + object.getClass().getName() + " object [" + object + "] does not correspond to value meta ["
          + toStringMeta() + "]" );
    }
  }
@Test
  public void testGetCompatibleString() throws KettleValueException {
    ValueMetaInteger valueMetaInteger = new ValueMetaInteger( "INTEGER" );
    valueMetaInteger.setType( 5 ); // Integer
    valueMetaInteger.setStorageType( 1 ); // STORAGE_TYPE_BINARY_STRING

    assertEquals( "2", valueMetaInteger.getCompatibleString( 2L )  ); //BACKLOG-15750
  }