com.scalar.db.sql.statement.ShowGrantsStatement Maven / Gradle / Ivy
The newest version!
package com.scalar.db.sql.statement;
import java.util.Objects;
import javax.annotation.Nullable;
public class ShowGrantsStatement implements CommandStatement {
@Nullable public final String username;
private ShowGrantsStatement(@Nullable String username) {
this.username = username;
}
@Override
public String toSql() {
return "SHOW GRANTS" + (username == null ? "" : " FOR " + username);
}
@Override
public R accept(CommandStatementVisitor 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 ShowGrantsStatement)) {
return false;
}
ShowGrantsStatement that = (ShowGrantsStatement) o;
return Objects.equals(username, that.username);
}
@Override
public int hashCode() {
return Objects.hashCode(username);
}
public static ShowGrantsStatement create(@Nullable String username) {
return new ShowGrantsStatement(username);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy