package com.chenyang.druid.sql.dialect.mysql.ast.statement;

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.SQLName;
import com.chenyang.druid.sql.ast.expr.SQLIntegerExpr;
import com.chenyang.druid.sql.ast.statement.SQLExprTableSource;
import com.chenyang.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;
import java.util.ArrayList;
import java.util.List;

public class MySqlFlushStatement extends MySqlStatementImpl {
   private boolean noWriteToBinlog = false;
   private boolean local = false;
   private final List<SQLExprTableSource> tables = new ArrayList();
   private boolean withReadLock = false;
   private boolean forExport;
   private boolean binaryLogs;
   private boolean desKeyFile;
   private boolean engineLogs;
   private boolean errorLogs;
   private boolean generalLogs;
   private boolean hots;
   private boolean logs;
   private boolean master;
   private boolean privileges;
   private boolean optimizerCosts;
   private boolean queryCache;
   private boolean relayLogs;
   private SQLExpr relayLogsForChannel;
   private boolean slowLogs;
   private boolean status;
   private boolean userResources;
   private boolean tableOption;
   private SQLIntegerExpr version;

   public boolean isNoWriteToBinlog() {
      return this.noWriteToBinlog;
   }

   public void setNoWriteToBinlog(boolean noWriteToBinlog) {
      this.noWriteToBinlog = noWriteToBinlog;
   }

   public boolean isLocal() {
      return this.local;
   }

   public void setLocal(boolean local) {
      this.local = local;
   }

   public List<SQLExprTableSource> getTables() {
      return this.tables;
   }

   public boolean isWithReadLock() {
      return this.withReadLock;
   }

   public void setWithReadLock(boolean withReadLock) {
      this.withReadLock = withReadLock;
   }

   public boolean isForExport() {
      return this.forExport;
   }

   public void setForExport(boolean forExport) {
      this.forExport = forExport;
   }

   public boolean isBinaryLogs() {
      return this.binaryLogs;
   }

   public void setBinaryLogs(boolean binaryLogs) {
      this.binaryLogs = binaryLogs;
   }

   public boolean isDesKeyFile() {
      return this.desKeyFile;
   }

   public void setDesKeyFile(boolean desKeyFile) {
      this.desKeyFile = desKeyFile;
   }

   public boolean isEngineLogs() {
      return this.engineLogs;
   }

   public void setEngineLogs(boolean engineLogs) {
      this.engineLogs = engineLogs;
   }

   public boolean isGeneralLogs() {
      return this.generalLogs;
   }

   public void setGeneralLogs(boolean generalLogs) {
      this.generalLogs = generalLogs;
   }

   public boolean isHots() {
      return this.hots;
   }

   public void setHots(boolean hots) {
      this.hots = hots;
   }

   public boolean isLogs() {
      return this.logs;
   }

   public void setLogs(boolean logs) {
      this.logs = logs;
   }

   public boolean isPrivileges() {
      return this.privileges;
   }

   public void setPrivileges(boolean privileges) {
      this.privileges = privileges;
   }

   public boolean isOptimizerCosts() {
      return this.optimizerCosts;
   }

   public void setOptimizerCosts(boolean optimizerCosts) {
      this.optimizerCosts = optimizerCosts;
   }

   public boolean isQueryCache() {
      return this.queryCache;
   }

   public void setQueryCache(boolean queryCache) {
      this.queryCache = queryCache;
   }

   public boolean isRelayLogs() {
      return this.relayLogs;
   }

   public void setRelayLogs(boolean relayLogs) {
      this.relayLogs = relayLogs;
   }

   public SQLExpr getRelayLogsForChannel() {
      return this.relayLogsForChannel;
   }

   public void setRelayLogsForChannel(SQLExpr relayLogsForChannel) {
      this.relayLogsForChannel = relayLogsForChannel;
   }

   public boolean isSlowLogs() {
      return this.slowLogs;
   }

   public void setSlowLogs(boolean showLogs) {
      this.slowLogs = showLogs;
   }

   public boolean isStatus() {
      return this.status;
   }

   public void setStatus(boolean status) {
      this.status = status;
   }

   public boolean isUserResources() {
      return this.userResources;
   }

   public void setUserResources(boolean userResources) {
      this.userResources = userResources;
   }

   public boolean isErrorLogs() {
      return this.errorLogs;
   }

   public void setErrorLogs(boolean errorLogs) {
      this.errorLogs = errorLogs;
   }

   public boolean isTableOption() {
      return this.tableOption;
   }

   public void setTableOption(boolean tableOption) {
      this.tableOption = tableOption;
   }

   public void accept0(MySqlASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.tables);
         this.acceptChild(visitor, this.relayLogsForChannel);
      }

      visitor.endVisit(this);
   }

   public void addTable(SQLName name) {
      if (name != null) {
         this.addTable(new SQLExprTableSource(name));
      }
   }

   public void addTable(SQLExprTableSource table) {
      if (table != null) {
         table.setParent(this);
         this.tables.add(table);
      }
   }

   public SQLIntegerExpr getVersion() {
      return this.version;
   }

   public void setVersion(SQLIntegerExpr version) {
      this.version = version;
   }

   public boolean isMaster() {
      return this.master;
   }

   public void setMaster(boolean master) {
      this.master = master;
   }
}
