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

import com.alibaba.druid.sql.ast.SQLName;
import com.alibaba.druid.sql.ast.SQLObjectImpl;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
import java.util.ArrayList;
import java.util.List;

public class SQLAlterTableImportPartition extends SQLObjectImpl implements SQLAlterTableItem {
   private final List<SQLName> partitions = new ArrayList(4);
   private boolean tablespace;

   public List<SQLName> getPartitions() {
      return this.partitions;
   }

   public void addPartition(SQLName partition) {
      if (partition != null) {
         partition.setParent(this);
      }

      this.partitions.add(partition);
   }

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

      visitor.endVisit(this);
   }

   public boolean isTablespace() {
      return this.tablespace;
   }

   public void setTablespace(boolean tablespace) {
      this.tablespace = tablespace;
   }
}
