[grid] Fine graining matching logic for Strings
This helps to match properly Strings when they
have different upper/lower case.
@@ -51,7 +51,13 @@ public boolean matches(Capabilities stereotype, Capabilities capabilities) {
.filter(name -> !name.contains(":"))
.map(name -> {
Object value = capabilities.getCapability(name);
- return value == null || Objects.equals(stereotype.getCapability(name), value);
+ boolean matches;
+ if (value instanceof String) {
+ matches = stereotype.getCapability(name).toString().equalsIgnoreCase(value.toString());
+ } else {
+ matches = value == null || Objects.equals(stereotype.getCapability(name), value);
+ }
+ return matches;
})
.reduce(Boolean::logicalAnd)
.orElse(false);
