package com.alibaba.druid.sql.dialect.postgresql.ast.stmt.alterTable;

import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.statement.SQLAlterTableItem;
import com.alibaba.druid.sql.dialect.postgresql.ast.PGSQLObject;
import com.alibaba.druid.sql.dialect.postgresql.ast.PGSQLObjectImpl;
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;

public class PGAlterTableValidateConstraint extends PGSQLObjectImpl implements SQLAlterTableItem, PGSQLObject {
   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((PGASTVisitor)visitor);
   }

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

      visitor.endVisit(this);
   }

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