package com.chenyang.druid.sql.dialect.gauss.ast.stmt.alterTable;

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.statement.SQLAlterTableItem;
import com.chenyang.druid.sql.dialect.gauss.ast.GaussSQLObject;
import com.chenyang.druid.sql.dialect.gauss.ast.GaussSQLObjectImpl;
import com.chenyang.druid.sql.dialect.gauss.visitor.GaussASTVisitor;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class GaussAlterTableDisableEnabelTrigger extends GaussSQLObjectImpl implements SQLAlterTableItem, GaussSQLObject {
   private boolean isEnable;
   private SQLExpr trigger;
   private Type type = null;

   public SQLExpr getTrigger() {
      return this.trigger;
   }

   public void setTrigger(SQLExpr trigger) {
      this.trigger = trigger;
      trigger.setParent(this);
   }

   public Type getType() {
      return this.type;
   }

   public void setType(Type type) {
      this.type = type;
   }

   public boolean isEnable() {
      return this.isEnable;
   }

   public void setEnable(boolean enable) {
      this.isEnable = enable;
   }

   public void accept0(SQLASTVisitor visitor) {
      this.accept0((GaussASTVisitor)visitor);
   }

   public void accept0(GaussASTVisitor visitor) {
      if (visitor.visit(this) && this.trigger != null) {
         this.trigger.accept(visitor);
      }

      visitor.endVisit(this);
   }

   public GaussAlterTableDisableEnabelTrigger clone() {
      GaussAlterTableDisableEnabelTrigger c = new GaussAlterTableDisableEnabelTrigger();
      c.setTrigger(this.trigger.clone());
      c.type = this.type;
      c.isEnable = this.isEnable;
      return c;
   }

   public static enum Type {
      all,
      user;
   }
}
