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.SQLStatementImpl;
import com.alibaba.druid.sql.ast.statement.SQLCreateStatement;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
import java.util.HashMap;
import java.util.Map;

public class SQLCreateResourceGroupStatement extends SQLStatementImpl implements SQLCreateStatement {
   private SQLName name;
   private Map<String, SQLExpr> properties = new HashMap();
   private Boolean enable;

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

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

      this.name = x;
   }

   public void addProperty(String name, SQLExpr value) {
      if (value != null) {
         value.setParent(this);
      }

      this.properties.put(name, value);
   }

   public Boolean getEnable() {
      return this.enable;
   }

   public void setEnable(Boolean enable) {
      this.enable = enable;
   }

   public Map<String, SQLExpr> getProperties() {
      return this.properties;
   }

   public void accept0(SQLASTVisitor v) {
      if (v.visit(this)) {
         this.acceptChild(v, this.name);

         for(SQLExpr value : this.properties.values()) {
            this.acceptChild(v, value);
         }
      }

      v.endVisit(this);
   }
}
