[logseq-plugin-git:commit] 2023-08-16T07:00:50.621Z
This commit is contained in:
parent
da27837be3
commit
7db7ff543e
1
journals/2023_08_16.md
Normal file
1
journals/2023_08_16.md
Normal file
@ -0,0 +1 @@
|
||||
- https://www.amazon.de/Magic-Cleaning-richtiges-Aufr%C3%A4umen-ver%C3%A4ndert/dp/3499624818 #TODO
|
||||
@ -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;
|
||||
}
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user