All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickzetta.platform.client.SingleRowCreate Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.clickzetta.platform.client;

import com.clickzetta.platform.client.api.Row;
import com.clickzetta.platform.client.api.Stream;

public interface SingleRowCreate extends RowCreate {

  /**
   * create InsertRow.
   *
   * @return
   */
  Row createInsertRow();

  /**
   * create InsertIgnoreRow.
   *
   * @return
   */
  Row createInsertIgnoreRow();

  /**
   * create UpdateRow.
   *
   * @return
   */
  Row createUpdateRow();

  /**
   * create UpsertRow.
   *
   * @return
   */
  Row createUpsertRow();

  /**
   * create DeleteRow.
   *
   * @return
   */
  Row createDeleteRow();

  /**
   * create DeleteIgnoreRow.
   *
   * @return
   */
  Row createDeleteIgnoreRow();

  /**
   * create stream row with target operator.
   *
   * @param operator
   * @return
   */
  default Row createRow(Operator operator) {
    Row row = null;
    switch (operator) {
      case INSERT:
        row = createInsertRow();
        break;
      case INSERT_IGNORE:
        row = createInsertIgnoreRow();
        break;
      case UPDATE:
        row = createUpdateRow();
        break;
      case UPSERT:
        row = createUpsertRow();
        break;
      case DELETE:
        row = createDeleteRow();
        break;
      case DELETE_IGNORE:
        row = createDeleteIgnoreRow();
        break;
    }
    return row;
  }

  @Deprecated
  default Row createRow(Stream.Operator operator) {
    Row row = null;
    switch (operator) {
      case INSERT:
        row = createInsertRow();
        break;
      case INSERT_IGNORE:
        row = createInsertIgnoreRow();
        break;
      case UPDATE:
        row = createUpdateRow();
        break;
      case UPSERT:
        row = createUpsertRow();
        break;
      case DELETE:
        row = createDeleteRow();
        break;
      case DELETE_IGNORE:
        row = createDeleteIgnoreRow();
        break;
    }
    return row;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy