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

com.scalar.db.sql.statement.DropUserStatement 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 DropUserStatement implements DclStatement {

  public final String username;

  private DropUserStatement(String username) {
    this.username = username;
  }

  @Override
  public String toSql() {
    return "DROP USER \"" + username + "\"";
  }

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

  @Override
  public  R accept(StatementVisitor 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 DropUserStatement)) {
      return false;
    }
    DropUserStatement that = (DropUserStatement) o;
    return Objects.equals(username, that.username);
  }

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

  public static DropUserStatement create(String username) {
    return new DropUserStatement(username);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy