class TableDiff {

  @VisibleForTesting
  static void diffRowValues(
      RowBuilder rowBuilder,
      @Nullable Row baseRow,
      @Nullable Row deltaRow,
      TableMetadata inputMetadata) {
    checkArgument(baseRow != null || deltaRow != null, "Both base and delta rows cannot be null");
    checkArgument(rowBuilder != null, "rowBuilder cannot be null");
    checkArgument(inputMetadata.getColumnMetadata() != null, "columns cannot be null");

    String keyStatus =
        baseRow == null
            ? COL_KEY_STATUS_ONLY_DELTA
            : deltaRow == null ? COL_KEY_STATUS_ONLY_BASE : COL_KEY_STATUS_BOTH;
    rowBuilder.put(COL_KEY_PRESENCE, keyStatus);

    for (ColumnMetadata cm : inputMetadata.getColumnMetadata()) {
      if (cm.getIsKey()) {
        continue;
      }
      Object baseValue = baseRow == null ? null : baseRow.get(cm.getName(), cm.getSchema());
      Object deltaValue = deltaRow == null ? null : deltaRow.get(cm.getName(), cm.getSchema());
      rowBuilder
          .put(baseColumnName(cm.getName()), baseValue)
          .put(deltaColumnName(cm.getName()), deltaValue);
    }
  }

  private  TableDiff();

}