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

com.scalar.db.sql.statement.DropCoordinatorTablesStatement Maven / Gradle / Ivy

There is a newer version: 3.14.0
Show newest version
package com.scalar.db.sql.statement;

import java.util.Objects;
import javax.annotation.concurrent.Immutable;

@Immutable
public class DropCoordinatorTablesStatement implements DdlStatement {

  public final boolean ifExist;

  private DropCoordinatorTablesStatement(boolean ifExist) {
    this.ifExist = ifExist;
  }

  @Override
  public String toSql() {
    StringBuilder builder = new StringBuilder("DROP COORDINATOR TABLES");
    if (ifExist) {
      builder.append(" IF EXIST");
    }
    return builder.toString();
  }

  @Override
  public  R accept(StatementVisitor visitor, C context) {
    return visitor.visit(this, context);
  }

  @Override
  public  R accept(DdlStatementVisitor visitor, C context) {
    return visitor.visit(this, context);
  }

  @Override
  public String toString() {
    return toSql();
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof DropCoordinatorTablesStatement)) {
      return false;
    }
    DropCoordinatorTablesStatement that = (DropCoordinatorTablesStatement) o;
    return ifExist == that.ifExist;
  }

  @Override
  public int hashCode() {
    return Objects.hash(ifExist);
  }

  public static DropCoordinatorTablesStatement create(boolean ifExist) {
    return new DropCoordinatorTablesStatement(ifExist);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy