public static void setTimeValuePair(TimeValuePair from, TimeValuePair to) {
    to.setTimestamp(from.getTimestamp());
    switch (from.getValue().getDataType()) {
      case INT32:
      case DATE:
        to.getValue().setInt(from.getValue().getInt());
        break;
      case INT64:
      case TIMESTAMP:
        to.getValue().setLong(from.getValue().getLong());
        break;
      case FLOAT:
        to.getValue().setFloat(from.getValue().getFloat());
        break;
      case DOUBLE:
        to.getValue().setDouble(from.getValue().getDouble());
        break;
      case TEXT:
      case BLOB:
      case STRING:
        to.getValue().setBinary(from.getValue().getBinary());
        break;
      case BOOLEAN:
        to.getValue().setBoolean(from.getValue().getBoolean());
        break;
      default:
        throw new UnSupportedDataTypeException(String.valueOf(from.getValue().getDataType()));
    }
  }
get given data's current (time,value) pair.

@param data -batch data
@return -given data's (time,value) pair
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/TimeValuePairUtils.java