Skip to content

Commit

Permalink
Fix omitted getters; make protected fields private
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Dec 27, 2024
1 parent 7ca16a7 commit 28eb1f1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
8 changes: 4 additions & 4 deletions partiql-ast/api/partiql-ast.api
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,8 @@ public class org/partiql/ast/DataType$StructField : org/partiql/ast/AstNode {
protected fun canEqual (Ljava/lang/Object;)Z
public fun equals (Ljava/lang/Object;)Z
public fun getChildren ()Ljava/util/List;
public fun getComment ()Ljava/lang/String;
public fun getConstraints ()Ljava/util/List;
public fun getName ()Lorg/partiql/ast/Identifier;
public fun getType ()Lorg/partiql/ast/DataType;
public fun hashCode ()I
Expand Down Expand Up @@ -1244,14 +1246,14 @@ public class org/partiql/ast/QueryBody$SFW$Builder {
}

public class org/partiql/ast/QueryBody$SetOp : org/partiql/ast/QueryBody {
public field lhs Lorg/partiql/ast/expr/Expr;
public field rhs Lorg/partiql/ast/expr/Expr;
public fun <init> (Lorg/partiql/ast/SetOp;ZLorg/partiql/ast/expr/Expr;Lorg/partiql/ast/expr/Expr;)V
public fun accept (Lorg/partiql/ast/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object;
public static fun builder ()Lorg/partiql/ast/QueryBody$SetOp$Builder;
protected fun canEqual (Ljava/lang/Object;)Z
public fun equals (Ljava/lang/Object;)Z
public fun getChildren ()Ljava/util/List;
public fun getLhs ()Lorg/partiql/ast/expr/Expr;
public fun getRhs ()Lorg/partiql/ast/expr/Expr;
public fun getType ()Lorg/partiql/ast/SetOp;
public fun hashCode ()I
public fun isOuter ()Z
Expand Down Expand Up @@ -1572,7 +1574,6 @@ public class org/partiql/ast/ddl/PartitionBy$Builder {
}

public abstract class org/partiql/ast/ddl/TableConstraint : org/partiql/ast/AstNode {
protected final field name Lorg/partiql/ast/IdentifierChain;
protected fun <init> (Lorg/partiql/ast/IdentifierChain;)V
public fun getName ()Lorg/partiql/ast/IdentifierChain;
}
Expand Down Expand Up @@ -2648,7 +2649,6 @@ public class org/partiql/ast/expr/ExprWindow$Over$Builder {
}

public abstract class org/partiql/ast/expr/PathStep : org/partiql/ast/AstNode {
protected final field next Lorg/partiql/ast/expr/PathStep;
protected fun <init> (Lorg/partiql/ast/expr/PathStep;)V
public fun getNext ()Lorg/partiql/ast/expr/PathStep;
}
Expand Down
3 changes: 3 additions & 0 deletions partiql-ast/src/main/java/org/partiql/ast/DataType.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ public static class StructField extends AstNode {
private final boolean optional;

@Nullable
@Getter
private final List<AttributeConstraint> constraints;

@Nullable
@Getter
private final String comment;

public StructField(
Expand Down
6 changes: 4 additions & 2 deletions partiql-ast/src/main/java/org/partiql/ast/QueryBody.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ public static class SetOp extends QueryBody {
private final boolean outer;

@NotNull
public Expr lhs;
@Getter
private final Expr lhs;

@NotNull
public Expr rhs;
@Getter
private final Expr rhs;

public SetOp(@NotNull org.partiql.ast.SetOp type, boolean outer, @NotNull Expr lhs, @NotNull Expr rhs) {
this.type = type;
Expand Down
12 changes: 2 additions & 10 deletions partiql-ast/src/main/java/org/partiql/ast/SelectItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ public <R, C> R accept(@NotNull AstVisitor<R, C> visitor, C ctx) {
@EqualsAndHashCode(callSuper = false)
public static class Expr extends SelectItem {
@NotNull
@Getter
private final org.partiql.ast.expr.Expr expr;

@Nullable
@Getter
private final Identifier asAlias;

public Expr(@NotNull org.partiql.ast.expr.Expr expr, @Nullable Identifier asAlias) {
Expand All @@ -73,15 +75,5 @@ public List<AstNode> getChildren() {
public <R, C> R accept(@NotNull AstVisitor<R, C> visitor, C ctx) {
return visitor.visitSelectItemExpr(this, ctx);
}

@NotNull
public org.partiql.ast.expr.Expr getExpr() {
return this.expr;
}

@Nullable
public Identifier getAsAlias() {
return this.asAlias;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public abstract class TableConstraint extends AstNode {
@Nullable
@Getter
protected final IdentifierChain name;
private final IdentifierChain name;

protected TableConstraint(@Nullable IdentifierChain name) {
this.name = name;
Expand All @@ -40,7 +40,7 @@ public Unique(@Nullable IdentifierChain name, @NotNull List<Identifier> column,
@Override
public List<AstNode> getChildren() {
List<AstNode> kids = new ArrayList<>();
kids.add(name);
kids.add(getName());
kids.addAll(columns);
return kids;
}
Expand Down
6 changes: 5 additions & 1 deletion partiql-ast/src/main/java/org/partiql/ast/expr/PathStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public abstract class PathStep extends AstNode {
@Nullable
@Getter
protected final PathStep next;
private final PathStep next;

protected PathStep(@Nullable PathStep _next) {
this.next = _next;
Expand All @@ -41,6 +41,7 @@ public Field(@NotNull Identifier field, @Nullable PathStep next) {
@NotNull
public List<AstNode> getChildren() {
List<AstNode> kids = new ArrayList<>();
PathStep next = getNext();
if (next != null) {
kids.add(next);
}
Expand Down Expand Up @@ -72,6 +73,7 @@ public Element(@NotNull Expr element, @Nullable PathStep next) {
public List<AstNode> getChildren() {
List<AstNode> kids = new ArrayList<>();
kids.add(element);
PathStep next = getNext();
if (next != null) {
kids.add(next);
}
Expand All @@ -97,6 +99,7 @@ public AllElements(@Nullable PathStep next) {
@NotNull
public List<AstNode> getChildren() {
List<AstNode> kids = new ArrayList<>();
PathStep next = getNext();
if (next != null) {
kids.add(next);
}
Expand All @@ -122,6 +125,7 @@ public AllFields(@Nullable PathStep next) {
@NotNull
public List<AstNode> getChildren() {
List<AstNode> kids = new ArrayList<>();
PathStep next = getNext();
if (next != null) {
kids.add(next);
}
Expand Down

0 comments on commit 28eb1f1

Please sign in to comment.