[Minor] added function for ignoring paramBags by type
This commit is contained in:
parent
00e41fdc4a
commit
ab0930eec8
|
@ -45,6 +45,7 @@ public class StrolchElementToJsonVisitor
|
|||
|
||||
private MapOfSets<String, String> ignoredKeys;
|
||||
private Set<String> ignoredStates;
|
||||
private Set<String> ignoredBagTypes;
|
||||
|
||||
private BiConsumer<Resource, JsonObject> resourceHook;
|
||||
private BiConsumer<Order, JsonObject> orderHook;
|
||||
|
@ -60,6 +61,7 @@ public class StrolchElementToJsonVisitor
|
|||
public StrolchElementToJsonVisitor() {
|
||||
this.ignoredKeys = new MapOfSets<>();
|
||||
this.ignoredStates = new HashSet<>();
|
||||
this.ignoredBagTypes = new HashSet<>();
|
||||
}
|
||||
|
||||
public boolean isFlat() {
|
||||
|
@ -112,6 +114,11 @@ public class StrolchElementToJsonVisitor
|
|||
this.ignoredKeys.addElement(bagId, paramId);
|
||||
return this;
|
||||
}
|
||||
|
||||
public StrolchElementToJsonVisitor ignoreBagParameterTyp(String type) {
|
||||
this.ignoredBagTypes.add(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public StrolchElementToJsonVisitor resourceHook(BiConsumer<Resource, JsonObject> hook) {
|
||||
this.resourceHook = hook;
|
||||
|
@ -335,6 +342,8 @@ public class StrolchElementToJsonVisitor
|
|||
continue;
|
||||
|
||||
ParameterBag parameterBag = element.getParameterBag(bagId);
|
||||
if(ignoredBagTypes.contains(parameterBag.getType()))
|
||||
continue;
|
||||
|
||||
Set<String> parameterKeySet = parameterBag.getParameterKeySet();
|
||||
for (String paramId : parameterKeySet) {
|
||||
|
|
Loading…
Reference in New Issue