Created
May 11, 2021 01:36
-
-
Save xenogew/a00e6d399f22fe7444def8f2b5ab7129 to your computer and use it in GitHub Desktop.
Java one line of code using lambda for converting array to map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Map<String, String> getCookies(String cookieHeader) { | |
return Arrays.stream(cookieHeader.split(";")) | |
.map(String::trim) | |
.collect(Collectors.toMap(e -> e.split("=")[0], e -> e.split("=")[1])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment