public static boolean isUserMatchesAttributesThatAreStartFor()

in src/main/java/com/epam/digital/data/platform/keycloak/rest/api/ext/UserFilter.java [45:53]


  public static boolean isUserMatchesAttributesThatAreStartFor(UserModel userModel,
      Map<String, List<String>> attributesThatAreStartFor) {
    return attributesThatAreStartFor.isEmpty() ||
        attributesThatAreStartFor.entrySet().stream()
            .allMatch(entry -> isListEmpty(entry.getValue()) ||
                userModel.getAttributeStream(entry.getKey())
                    .anyMatch(value -> entry.getValue().stream()
                        .anyMatch(attr -> attr.startsWith(value))));
  }