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

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.SQLName;
import com.chenyang.druid.sql.ast.SQLStatementImpl;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class SQLAlterMaterializedViewStatement extends SQLStatementImpl implements SQLAlterStatement {
   private SQLName name;
   private boolean refreshFast;
   private boolean refreshComplete;
   private boolean refreshForce;
   private boolean refreshOnCommit;
   private boolean refreshOnDemand;
   private boolean refreshStartWith;
   private boolean refreshNext;
   private Boolean enableQueryRewrite;
   private SQLExpr startWith;
   private SQLExpr next;
   protected boolean refreshOnOverWrite;

   public SQLName getName() {
      return this.name;
   }

   public void setName(SQLName name) {
      if (name != null) {
         name.setParent(this);
      }

      this.name = name;
   }

   public boolean isRefresh() {
      return this.refreshFast || this.refreshComplete || this.refreshForce || this.refreshOnDemand || this.refreshOnCommit || this.refreshStartWith || this.refreshNext || this.refreshOnOverWrite;
   }

   public boolean isRefreshFast() {
      return this.refreshFast;
   }

   public void setRefreshFast(boolean refreshFast) {
      this.refreshFast = refreshFast;
   }

   public boolean isRefreshComplete() {
      return this.refreshComplete;
   }

   public void setRefreshComplete(boolean refreshComplete) {
      this.refreshComplete = refreshComplete;
   }

   public boolean isRefreshForce() {
      return this.refreshForce;
   }

   public void setRefreshForce(boolean refreshForce) {
      this.refreshForce = refreshForce;
   }

   public boolean isRefreshOnCommit() {
      return this.refreshOnCommit;
   }

   public void setRefreshOnCommit(boolean refreshOnCommit) {
      this.refreshOnCommit = refreshOnCommit;
   }

   public boolean isRefreshOnDemand() {
      return this.refreshOnDemand;
   }

   public void setRefreshOnDemand(boolean refreshOnDemand) {
      this.refreshOnDemand = refreshOnDemand;
   }

   public boolean isRefreshOnOverWrite() {
      return this.refreshOnOverWrite;
   }

   public void setRefreshOnOverWrite(boolean refreshOnOverWrite) {
      this.refreshOnOverWrite = refreshOnOverWrite;
   }

   public boolean isRefreshStartWith() {
      return this.refreshStartWith;
   }

   public void setRefreshStartWith(boolean refreshStartWith) {
      this.refreshStartWith = refreshStartWith;
   }

   public boolean isRefreshNext() {
      return this.refreshNext;
   }

   public void setRefreshNext(boolean refreshNext) {
      this.refreshNext = refreshNext;
   }

   public Boolean getEnableQueryRewrite() {
      return this.enableQueryRewrite;
   }

   public void setEnableQueryRewrite(Boolean enableQueryRewrite) {
      this.enableQueryRewrite = enableQueryRewrite;
   }

   public SQLExpr getStartWith() {
      return this.startWith;
   }

   public void setStartWith(SQLExpr x) {
      if (x != null) {
         x.setParent(this);
      }

      this.startWith = x;
   }

   public SQLExpr getNext() {
      return this.next;
   }

   public void setNext(SQLExpr x) {
      if (x != null) {
         x.setParent(this);
      }

      this.next = x;
   }

   protected void accept0(SQLASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.name);
         this.acceptChild(visitor, this.startWith);
         this.acceptChild(visitor, this.next);
      }

      visitor.endVisit(this);
   }
}
