[logseq-plugin-git:commit] 2023-08-16T07:00:50.621Z

This commit is contained in:
Matthias Eckert 2023-08-16 09:00:51 +02:00
parent da27837be3
commit 7db7ff543e
2 changed files with 15 additions and 0 deletions

1
journals/2023_08_16.md Normal file
View File

@ -0,0 +1 @@
- https://www.amazon.de/Magic-Cleaning-richtiges-Aufr%C3%A4umen-ver%C3%A4ndert/dp/3499624818 #TODO

View File

@ -0,0 +1,14 @@
- String key value to map [[Code Snippet]] [[Java]]
- ``` java
private MultiValueMap<String, String> params(final String... params) {
if (params.length % 2 != 0) {
throw new IllegalArgumentException("The params need to be as key value pair");
}
final LinkedMultiValueMap<String, String> result = new LinkedMultiValueMap<>();
IntStream.range(0, params.length / 2)
.map(i -> i * 2)
.mapToObj(i -> new ImmutablePair<>(params[i], params[i + 1]))
.forEach(p -> result.add(p.getLeft(), p.getRight()));
return result;
}
```