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

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.SQLObject;
import com.chenyang.druid.sql.dialect.mariadb.visitor.MariadbASTVisitor;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class MariadbKillStatement extends MariadbStatementImpl {
   private Type type;
   private List<SQLExpr> threadIds = new ArrayList();

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

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

   public SQLExpr getThreadId() {
      return (SQLExpr)this.threadIds.get(0);
   }

   public void setThreadId(SQLExpr threadId) {
      if (this.threadIds.size() == 0) {
         this.threadIds.add(threadId);
      } else {
         this.threadIds.set(0, threadId);
      }
   }

   public List<SQLExpr> getThreadIds() {
      return this.threadIds;
   }

   public void accept0(MariadbASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.threadIds);
      }

      visitor.endVisit(this);
   }

   public List<SQLObject> getChildren() {
      return Collections.emptyList();
   }

   public static enum Type {
      CONNECTION,
      QUERY;
   }
}
