Skip to content

Commit

Permalink
add missing withAscDescPresent
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmotte committed Sep 23, 2020
1 parent 5da1656 commit 4c44866
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
public class OrderByElement {

public enum NullOrdering {

NULLS_FIRST,
NULLS_LAST
}

private Expression expression;
private boolean asc = true;
private boolean ascDescPresent = false;
private NullOrdering nullOrdering;
private boolean ascDesc = false;

public boolean isAsc() {
return asc;
Expand All @@ -36,16 +35,16 @@ public void setNullOrdering(NullOrdering nullOrdering) {
this.nullOrdering = nullOrdering;
}

public void setAsc(boolean b) {
asc = b;
public void setAsc(boolean asc) {
this.asc = asc;
}

public void setAscDescPresent(boolean b) {
ascDesc = b;
public void setAscDescPresent(boolean ascDescPresent) {
this.ascDescPresent = ascDescPresent;
}

public boolean isAscDescPresent() {
return ascDesc;
return ascDescPresent;
}

public void accept(OrderByVisitor orderByVisitor) {
Expand All @@ -67,7 +66,7 @@ public String toString() {

if (!asc) {
b.append(" DESC");
} else if (ascDesc) {
} else if (ascDescPresent) {
b.append(" ASC");
}

Expand All @@ -88,6 +87,11 @@ public OrderByElement withAsc(boolean asc) {
return this;
}

public OrderByElement withAscDescPresent(boolean ascDescPresent) {
this.setAscDescPresent(ascDescPresent);
return this;
}

public OrderByElement withNullOrdering(NullOrdering nullOrdering) {
this.setNullOrdering(nullOrdering);
return this;
Expand Down

0 comments on commit 4c44866

Please sign in to comment.