Skip to content

Commit e89eaf1

Browse files
Merge pull request #10 from mateusz-bajorek/fix_filter_operator
Fixes #9 - filter operator correctly added to the notification request
2 parents dfe4667 + d79e4a6 commit e89eaf1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/main/java/com/currencyfair/onesignal/model/notification/Filter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ public class Filter {
5757
*/
5858
private Operator operator;
5959

60-
public Filter(Field field, String key, Relation relation, String value, Operator operator) {
60+
public Filter(Field field, String key, Relation relation, String value) {
6161
this.field = field;
6262
this.key = key;
6363
this.relation = relation;
6464
this.value = value;
65+
}
66+
67+
public Filter(Operator operator) {
6568
this.operator = operator;
6669
}
6770

src/main/java/com/currencyfair/onesignal/model/notification/NotificationRequestBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ public NotificationRequestBuilder withFilter(Filter filter) {
153153
return this;
154154
}
155155

156+
public NotificationRequestBuilder withFilterOperator(Operator operator) {
157+
filters.add(new Filter(operator));
158+
return this;
159+
}
160+
156161
public NotificationRequestBuilder withIncludePlayerIds(List<String> includePlayerIds) {
157162
this.includePlayerIds = includePlayerIds;
158163
return this;

0 commit comments

Comments
 (0)