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

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.SQLObject;
import com.chenyang.druid.sql.dialect.spark.ast.SparkSqlExprImpl;
import com.chenyang.druid.sql.dialect.spark.visitor.SparkVisitor;
import java.util.Arrays;
import java.util.List;
import util.sqlparse.visitor.common.Objects;

public class SparkDateExpr extends SparkSqlExprImpl {
   private SQLExpr value;

   public SQLExpr getValue() {
      return this.value;
   }

   public void setValue(SQLExpr value) {
      this.value = value;
   }

   public SparkDateExpr clone() {
      SparkDateExpr e = new SparkDateExpr();
      if (this.value != null) {
         e.value = this.value.clone();
      }

      return e;
   }

   public boolean equals(Object o) {
      if (this == o) {
         return true;
      } else if (o != null && this.getClass() == o.getClass()) {
         SparkDateExpr that = (SparkDateExpr)o;
         return Objects.equals(this.value, that.value);
      } else {
         return false;
      }
   }

   public int hashCode() {
      return Objects.hash(this.value);
   }

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

   public void accept0(SparkVisitor v) {
      if (v.visit(this)) {
         this.acceptChild(v, this.value);
      }

      v.endVisit(this);
   }
}
