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

import com.chenyang.druid.sql.ast.SQLName;
import com.chenyang.druid.sql.ast.SQLObjectImpl;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class SQLAlterTableRenameIndex extends SQLObjectImpl implements SQLAlterTableItem {
   private SQLName name;
   private SQLName to;

   public SQLAlterTableRenameIndex(SQLName name, SQLName to) {
      this.setName(name);
      this.setTo(to);
   }

   public SQLAlterTableRenameIndex() {
   }

   public void accept0(SQLASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.name);
         this.acceptChild(visitor, this.to);
      }

      visitor.endVisit(this);
   }

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

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

      this.name = x;
   }

   public SQLName getTo() {
      return this.to;
   }

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

      this.to = x;
   }
}
