package com.alibaba.druid.sql.dialect.spark.ast;

import com.alibaba.druid.sql.ast.SQLCommentHint;
import com.alibaba.druid.sql.ast.SQLExpr;

public abstract class SparkSqlExprImpl extends SparkSqlObjectImpl implements SQLExpr {
   protected SQLCommentHint hint;

   public SQLExpr clone() {
      throw new UnsupportedOperationException();
   }

   public SQLCommentHint getHint() {
      return this.hint;
   }

   public void setHint(SQLCommentHint hint) {
      this.hint = hint;
   }

   public boolean objectEquals(Object a, Object b) {
      if (a == b) {
         return true;
      } else if (!this.objectNullEquals(a, b)) {
         return false;
      } else {
         return a == null && b == null ? true : a.equals(b);
      }
   }

   public boolean objectNullEquals(Object a, Object b) {
      if (a == b) {
         return true;
      } else if (a == null && b != null) {
         return false;
      } else if (a != null && b == null) {
         return false;
      } else if (a == null && b == null) {
         return true;
      } else {
         return a == null || a.getClass() == b.getClass();
      }
   }
}
