package com.chenyang.druid.sql.dialect.oracle.ast.expr;

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.SQLObject;
import com.chenyang.druid.sql.dialect.oracle.ast.OracleSQLObjectImpl;
import com.chenyang.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
import java.util.Arrays;
import java.util.List;

public class OracleDatetimeExpr extends OracleSQLObjectImpl implements SQLExpr {
   private SQLExpr expr;
   private SQLExpr timeZone;

   public OracleDatetimeExpr() {
   }

   public OracleDatetimeExpr(SQLExpr expr, SQLExpr timeZone) {
      this.expr = expr;
      this.timeZone = timeZone;
   }

   public void accept0(OracleASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.expr);
         this.acceptChild(visitor, this.timeZone);
      }

      visitor.endVisit(this);
   }

   public SQLExpr getExpr() {
      return this.expr;
   }

   public void setExpr(SQLExpr expr) {
      this.expr = expr;
   }

   public SQLExpr getTimeZone() {
      return this.timeZone;
   }

   public void setTimeZone(SQLExpr timeZone) {
      this.timeZone = timeZone;
   }

   public OracleDatetimeExpr clone() {
      OracleDatetimeExpr x = new OracleDatetimeExpr();
      if (this.expr != null) {
         x.setExpr(this.expr.clone());
      }

      if (this.timeZone != null) {
         x.setTimeZone(this.timeZone.clone());
      }

      return x;
   }

   public List<SQLObject> getChildren() {
      return Arrays.asList(this.expr, this.timeZone);
   }
}
