Skip to content

Commit

Permalink
feat: update and project the microprofile settings
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Oct 1, 2023
1 parent 6b3e67c commit a40fe51
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public List<Object> prefix(String prefix) {
Objects.requireNonNull(prefix, "prefix is required");
return StreamSupport.stream(config.getPropertyNames().spliterator(), false)
.filter(p -> p.startsWith(prefix))
.map(p -> config.getValue(p, String.class))
.map(p -> config.getOptionalValue(p, String.class))
.filter(Optional::isPresent)
.flatMap(Optional::stream)
.collect(Collectors.toUnmodifiableList());
}

Expand Down Expand Up @@ -132,7 +134,9 @@ public List<Object> prefix(Iterable<String> prefixes) {
return StreamSupport.stream(config.getPropertyNames().spliterator(), false)
.filter(prefixCondition)
.sorted()
.map(p -> config.getValue(p, String.class))
.map(p -> config.getOptionalValue(p, String.class))
.filter(Optional::isPresent)
.flatMap(Optional::stream)
.collect(Collectors.toList());
}

Expand Down

0 comments on commit a40fe51

Please sign in to comment.