Skip to content

Commit

Permalink
Add if_ne and if_num_ne built-in placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
Almighty-Satan committed Nov 24, 2024
1 parent cce4615 commit d2ee23b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,10 @@ interface Builder {
* Adds built-in placeholders, including, but no limited to
* <ul>
* <li>if_eq</li>
* <li>if_ne</li>
* <li>if_neq</li>
* <li>if_num_eq</li>
* <li>if_num_ne</li>
* <li>if_num_neq</li>
* <li>if_num_lt</li>
* <li>if_num_gt</li>
Expand All @@ -493,9 +495,11 @@ interface Builder {
});

this.add(Placeholder.comparison("if_eq", String::equals));
this.add(Placeholder.comparison("if_ne", (arg0, arg1) -> !arg0.equals(arg1)));
this.add(Placeholder.comparison("if_neq", (arg0, arg1) -> !arg0.equals(arg1)));

this.add(numberComparison.apply("if_num_eq", (arg0, arg1) -> arg0.compareTo(arg1) == 0));
this.add(numberComparison.apply("if_num_ne", (arg0, arg1) -> arg0.compareTo(arg1) != 0));
this.add(numberComparison.apply("if_num_neq", (arg0, arg1) -> arg0.compareTo(arg1) != 0));
this.add(numberComparison.apply("if_num_lt", (arg0, arg1) -> arg0.compareTo(arg1) < 0));
this.add(numberComparison.apply("if_num_gt", (arg0, arg1) -> arg0.compareTo(arg1) > 0));
Expand Down

0 comments on commit d2ee23b

Please sign in to comment.