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

import com.alibaba.druid.sql.ast.SQLDataType;
import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.SQLName;
import com.alibaba.druid.sql.ast.SQLObjectImpl;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;

public class SQLAlterTableAlterColumn extends SQLObjectImpl implements SQLAlterTableItem {
   private SQLName originColumn;
   private SQLColumnDefinition column;
   private boolean setNotNull;
   private boolean dropNotNull;
   private SQLExpr setDefault;
   private boolean dropDefault;
   private SQLName first;
   private SQLName after;
   private SQLDataType dataType;

   protected void accept0(SQLASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.column);
         this.acceptChild(visitor, this.setDefault);
      }

      visitor.endVisit(this);
   }

   public SQLColumnDefinition getColumn() {
      return this.column;
   }

   public void setColumn(SQLColumnDefinition column) {
      this.column = column;
   }

   public boolean isSetNotNull() {
      return this.setNotNull;
   }

   public void setSetNotNull(boolean setNotNull) {
      this.setNotNull = setNotNull;
   }

   public boolean isDropNotNull() {
      return this.dropNotNull;
   }

   public void setDropNotNull(boolean dropNotNull) {
      this.dropNotNull = dropNotNull;
   }

   public SQLExpr getSetDefault() {
      return this.setDefault;
   }

   public void setSetDefault(SQLExpr setDefault) {
      this.setDefault = setDefault;
   }

   public boolean isDropDefault() {
      return this.dropDefault;
   }

   public void setDropDefault(boolean dropDefault) {
      this.dropDefault = dropDefault;
   }

   public SQLName getOriginColumn() {
      return this.originColumn;
   }

   public void setOriginColumn(SQLName x) {
      if (x != null) {
         x.setParent(this);
      }

      this.originColumn = x;
   }

   public SQLName getFirst() {
      return this.first;
   }

   public void setFirst(SQLName x) {
      if (x != null) {
         x.setParent(this);
      }

      this.first = x;
   }

   public SQLName getAfter() {
      return this.after;
   }

   public void setAfter(SQLName x) {
      if (x != null) {
         x.setParent(this);
      }

      this.after = x;
   }

   public SQLDataType getDataType() {
      return this.dataType;
   }

   public void setDataType(SQLDataType x) {
      if (x != null) {
         x.setParent(this);
      }

      this.dataType = x;
   }
}
