Auto saved by Logseq

This commit is contained in:
Matthias Eckert 2023-08-14 08:52:22 +02:00
parent de14b0747e
commit c299225157
2 changed files with 15 additions and 13 deletions

View File

@ -1,14 +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;
}
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;
}
```

View File

@ -21,5 +21,7 @@
- Wer braucht welche Software
- Mobilgeräte
- Wer soll welches Gerät haben
- Bechtle als Dienstleister, Inbetriebnahme immer im LAN von BDO Gebäude
- neue Geräte
- Bechtle als Dienstleister
- Inbetriebnahme immer im LAN von BDO Gebäude
- neue Geräte
- wer braucht wo sein Gerät