Commit 61e0b5f0 authored by Maxym Borodenko's avatar Maxym Borodenko

Extended clearFilters functionality

parent 2476d560
......@@ -110,6 +110,10 @@ public abstract class BasicModelFilter<T extends BasicModelFilter<T, R>, R exten
}
public void clearFilter(String jsonPath) throws NoSuchFieldException, IllegalAccessException {
this.clearFilter(jsonPath, true);
}
public void clearFilter(String jsonPath, boolean clearNullAndNotNull) throws NoSuchFieldException, IllegalAccessException {
String[] paths = jsonPath.split("\\.");
Object toClear = this;
......@@ -128,12 +132,14 @@ public abstract class BasicModelFilter<T extends BasicModelFilter<T, R>, R exten
field = clazz.getField(paths[i]);
}
if (clearNullAndNotNull) {
if (this.NULL != null) {
this.NULL.remove(jsonPath);
}
if (this.NOTNULL != null) {
this.NOTNULL.remove(jsonPath);
}
}
field.set(toClear, null);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment