package com.chenyang.druid.sql.dialect.greenplum.ast.stmt.alterTable;

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.statement.SQLAlterTableItem;
import com.chenyang.druid.sql.dialect.greenplum.ast.GPSQLObject;
import com.chenyang.druid.sql.dialect.greenplum.ast.GPSQLObjectImpl;
import com.chenyang.druid.sql.dialect.greenplum.visitor.GPASTVisitor;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class GPAlterTableValidateConstraint extends GPSQLObjectImpl implements SQLAlterTableItem, GPSQLObject {
   private SQLExpr constraint;

   public SQLExpr getConstraint() {
      return this.constraint;
   }

   public void setConstraint(SQLExpr constraint) {
      this.constraint = constraint;
      constraint.setParent(this);
   }

   public void accept0(SQLASTVisitor visitor) {
      this.accept0((GPASTVisitor)visitor);
   }

   public void accept0(GPASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.constraint.accept(visitor);
      }

      visitor.endVisit(this);
   }

   public GPAlterTableValidateConstraint clone() {
      GPAlterTableValidateConstraint c = new GPAlterTableValidateConstraint();
      c.setConstraint(this.constraint.clone());
      return c;
   }
}
