Compare commits
No commits in common. "adf05361b9aa853d7c3c7f7390b5a3d1e31f1f3c" and "37751e8d6b6e79cdd66b3211162b41b5db25956b" have entirely different histories.
adf05361b9
...
37751e8d6b
@ -1,14 +0,0 @@
|
|||||||
- 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