Skip to content

Commit

Permalink
[v1] Make AstNode equals and hashcode abstract; add missing impls (#1677
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alancai98 authored Dec 13, 2024
1 parent b651415 commit 02e9436
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions partiql-ast/api/partiql-ast.api
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ public abstract class org/partiql/ast/AstEnum : org/partiql/ast/AstNode {
public abstract class org/partiql/ast/AstNode {
public fun <init> ()V
public abstract fun accept (Lorg/partiql/ast/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object;
public abstract fun equals (Ljava/lang/Object;)Z
public abstract fun getChildren ()Ljava/util/List;
public fun getTag ()I
public abstract fun hashCode ()I
public fun setTag (I)V
}

Expand Down Expand Up @@ -886,7 +888,10 @@ public class org/partiql/ast/GroupBy$Key : org/partiql/ast/AstNode {
public fun <init> (Lorg/partiql/ast/expr/Expr;Lorg/partiql/ast/Identifier;)V
public fun accept (Lorg/partiql/ast/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object;
public static fun builder ()Lorg/partiql/ast/GroupBy$Key$Builder;
protected fun canEqual (Ljava/lang/Object;)Z
public fun equals (Ljava/lang/Object;)Z
public fun getChildren ()Ljava/util/List;
public fun hashCode ()I
}

public class org/partiql/ast/GroupBy$Key$Builder {
Expand Down Expand Up @@ -1001,7 +1006,10 @@ public class org/partiql/ast/Let$Binding : org/partiql/ast/AstNode {
public fun <init> (Lorg/partiql/ast/expr/Expr;Lorg/partiql/ast/Identifier;)V
public fun accept (Lorg/partiql/ast/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object;
public static fun builder ()Lorg/partiql/ast/Let$Binding$Builder;
protected fun canEqual (Ljava/lang/Object;)Z
public fun equals (Ljava/lang/Object;)Z
public fun getChildren ()Ljava/util/List;
public fun hashCode ()I
}

public class org/partiql/ast/Let$Binding$Builder {
Expand Down
6 changes: 6 additions & 0 deletions partiql-ast/src/main/java/org/partiql/ast/AstNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ public void setTag(int tag) {
public abstract List<AstNode> getChildren();

public abstract <R, C> R accept(@NotNull AstVisitor<R, C> visitor, C ctx);

@Override
public abstract int hashCode();

@Override
public abstract boolean equals(Object obj);
}
1 change: 1 addition & 0 deletions partiql-ast/src/main/java/org/partiql/ast/GroupBy.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public <R, C> R accept(@NotNull AstVisitor<R, C> visitor, C ctx) {
* TODO docs, equals, hashcode
*/
@lombok.Builder(builderClassName = "Builder")
@EqualsAndHashCode(callSuper = false)
public static class Key extends AstNode {
@NotNull
public final Expr expr;
Expand Down
1 change: 1 addition & 0 deletions partiql-ast/src/main/java/org/partiql/ast/Let.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public <R, C> R accept(@NotNull AstVisitor<R, C> visitor, C ctx) {
* TODO docs, equals, hashcode
*/
@lombok.Builder(builderClassName = "Builder")
@EqualsAndHashCode(callSuper = false)
public static class Binding extends AstNode {
@NotNull
public final Expr expr;
Expand Down

0 comments on commit 02e9436

Please sign in to comment.