@@ -22,6 +22,9 @@ public class Condition {
2222 @ JsonProperty ("filters" )
2323 private String filters ;
2424
25+ @ JsonProperty ("sortBy" )
26+ private String sortBy ;
27+
2528 public Condition setPattern (String pattern ) {
2629 this .pattern = pattern ;
2730 return this ;
@@ -80,6 +83,21 @@ public String getFilters() {
8083 return filters ;
8184 }
8285
86+ public Condition setSortBy (String sortBy ) {
87+ this .sortBy = sortBy ;
88+ return this ;
89+ }
90+
91+ /**
92+ * Sort criteria that trigger the rule. You can trigger composition rules based on the selected
93+ * sorting strategy set by the parameter `sortBy`. The rule will trigger if the value passed to
94+ * `sortBy` matches the one defined in the condition.
95+ */
96+ @ javax .annotation .Nullable
97+ public String getSortBy () {
98+ return sortBy ;
99+ }
100+
83101 @ Override
84102 public boolean equals (Object o ) {
85103 if (this == o ) {
@@ -93,13 +111,14 @@ public boolean equals(Object o) {
93111 Objects .equals (this .pattern , condition .pattern ) &&
94112 Objects .equals (this .anchoring , condition .anchoring ) &&
95113 Objects .equals (this .context , condition .context ) &&
96- Objects .equals (this .filters , condition .filters )
114+ Objects .equals (this .filters , condition .filters ) &&
115+ Objects .equals (this .sortBy , condition .sortBy )
97116 );
98117 }
99118
100119 @ Override
101120 public int hashCode () {
102- return Objects .hash (pattern , anchoring , context , filters );
121+ return Objects .hash (pattern , anchoring , context , filters , sortBy );
103122 }
104123
105124 @ Override
@@ -110,6 +129,7 @@ public String toString() {
110129 sb .append (" anchoring: " ).append (toIndentedString (anchoring )).append ("\n " );
111130 sb .append (" context: " ).append (toIndentedString (context )).append ("\n " );
112131 sb .append (" filters: " ).append (toIndentedString (filters )).append ("\n " );
132+ sb .append (" sortBy: " ).append (toIndentedString (sortBy )).append ("\n " );
113133 sb .append ("}" );
114134 return sb .toString ();
115135 }
0 commit comments