Skip to content

Commit

Permalink
[v1] Make AstNode equals and hashcode abstract; add missing impls
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Dec 10, 2024
1 parent 01ed70a commit bf15bdb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
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 @@ -17,4 +17,10 @@ public abstract class AstNode {
public abstract Collection<AstNode> children();

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 @@ -50,6 +50,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 @@ -37,6 +37,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 bf15bdb

Please sign in to comment.