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

import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.SQLName;
import com.alibaba.druid.sql.ast.SQLObject;
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr;
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;
import java.util.ArrayList;
import java.util.List;

public class MySqlLoadDataInFileStatement extends MySqlStatementImpl {
   private boolean lowPriority = false;
   private boolean concurrent = false;
   private boolean local = false;
   private SQLLiteralExpr fileName;
   private boolean replicate = false;
   private boolean ignore = false;
   private SQLName tableName;
   private String charset;
   private SQLLiteralExpr columnsTerminatedBy;
   private boolean columnsEnclosedOptionally = false;
   private SQLLiteralExpr columnsEnclosedBy;
   private SQLLiteralExpr columnsEscaped;
   private SQLLiteralExpr linesStartingBy;
   private SQLLiteralExpr linesTerminatedBy;
   private SQLExpr ignoreLinesNumber;
   private List<SQLExpr> setList = new ArrayList();
   private List<SQLExpr> columns = new ArrayList();
   private List<SQLExpr> partitionNames = new ArrayList();

   public boolean isLowPriority() {
      return this.lowPriority;
   }

   public void setLowPriority(boolean lowPriority) {
      this.lowPriority = lowPriority;
   }

   public boolean isConcurrent() {
      return this.concurrent;
   }

   public void setConcurrent(boolean concurrent) {
      this.concurrent = concurrent;
   }

   public boolean isLocal() {
      return this.local;
   }

   public void setLocal(boolean local) {
      this.local = local;
   }

   public SQLLiteralExpr getFileName() {
      return this.fileName;
   }

   public void setFileName(SQLLiteralExpr fileName) {
      this.fileName = fileName;
   }

   public boolean isReplicate() {
      return this.replicate;
   }

   public void setReplicate(boolean replicate) {
      this.replicate = replicate;
   }

   public boolean isIgnore() {
      return this.ignore;
   }

   public void setIgnore(boolean ignore) {
      this.ignore = ignore;
   }

   public SQLName getTableName() {
      return this.tableName;
   }

   public void setTableName(SQLName tableName) {
      this.tableName = tableName;
   }

   public String getCharset() {
      return this.charset;
   }

   public void setCharset(String charset) {
      this.charset = charset;
   }

   public SQLLiteralExpr getColumnsTerminatedBy() {
      return this.columnsTerminatedBy;
   }

   public void setColumnsTerminatedBy(SQLLiteralExpr columnsTerminatedBy) {
      this.columnsTerminatedBy = columnsTerminatedBy;
   }

   public boolean isColumnsEnclosedOptionally() {
      return this.columnsEnclosedOptionally;
   }

   public void setColumnsEnclosedOptionally(boolean columnsEnclosedOptionally) {
      this.columnsEnclosedOptionally = columnsEnclosedOptionally;
   }

   public SQLLiteralExpr getColumnsEnclosedBy() {
      return this.columnsEnclosedBy;
   }

   public void setColumnsEnclosedBy(SQLLiteralExpr columnsEnclosedBy) {
      this.columnsEnclosedBy = columnsEnclosedBy;
   }

   public SQLLiteralExpr getColumnsEscaped() {
      return this.columnsEscaped;
   }

   public void setColumnsEscaped(SQLLiteralExpr columnsEscaped) {
      this.columnsEscaped = columnsEscaped;
   }

   public SQLLiteralExpr getLinesStartingBy() {
      return this.linesStartingBy;
   }

   public void setLinesStartingBy(SQLLiteralExpr linesStartingBy) {
      this.linesStartingBy = linesStartingBy;
   }

   public SQLLiteralExpr getLinesTerminatedBy() {
      return this.linesTerminatedBy;
   }

   public void setLinesTerminatedBy(SQLLiteralExpr linesTerminatedBy) {
      this.linesTerminatedBy = linesTerminatedBy;
   }

   public SQLExpr getIgnoreLinesNumber() {
      return this.ignoreLinesNumber;
   }

   public void setIgnoreLinesNumber(SQLExpr ignoreLinesNumber) {
      this.ignoreLinesNumber = ignoreLinesNumber;
   }

   public List<SQLExpr> getSetList() {
      return this.setList;
   }

   public void accept0(MySqlASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.fileName);
         this.acceptChild(visitor, this.tableName);
         this.acceptChild(visitor, this.columnsTerminatedBy);
         this.acceptChild(visitor, this.columnsEnclosedBy);
         this.acceptChild(visitor, this.columnsEscaped);
         this.acceptChild(visitor, this.linesStartingBy);
         this.acceptChild(visitor, this.linesTerminatedBy);
         this.acceptChild(visitor, this.ignoreLinesNumber);
         this.acceptChild(visitor, this.setList);
      }

      visitor.endVisit(this);
   }

   public List<SQLObject> getChildren() {
      List<SQLObject> children = new ArrayList();
      if (this.fileName != null) {
         children.add(this.fileName);
      }

      if (this.tableName != null) {
         children.add(this.tableName);
      }

      if (this.columnsTerminatedBy != null) {
         children.add(this.columnsTerminatedBy);
      }

      if (this.columnsEnclosedBy != null) {
         children.add(this.columnsEnclosedBy);
      }

      if (this.columnsEscaped != null) {
         children.add(this.columnsEscaped);
      }

      if (this.linesStartingBy != null) {
         children.add(this.linesStartingBy);
      }

      if (this.linesTerminatedBy != null) {
         children.add(this.linesTerminatedBy);
      }

      if (this.ignoreLinesNumber != null) {
         children.add(this.ignoreLinesNumber);
      }

      return children;
   }

   public List<SQLExpr> getColumns() {
      return this.columns;
   }

   public void setColumns(List<SQLExpr> columns) {
      this.columns = columns;
   }

   public void setSetList(List<SQLExpr> setList) {
      this.setList = setList;
   }

   public List<SQLExpr> getPartitionNames() {
      return this.partitionNames;
   }

   public void setPartitionNames(List<SQLExpr> partitionNames) {
      this.partitionNames = partitionNames;
   }
}
