Last active
March 28, 2018 14:06
-
-
Save hemanth415/1e155d331a7a2cef8ff11ab3ba6bd1f4 to your computer and use it in GitHub Desktop.
Convert Legacy Dictionary to a Map in java
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
// Using Google Core Library and Java 8 | |
public Map<String, Object> transformDictionary(Dictionary<String, Object> props) { | |
Iterator<String> keysIter = Iterators.forEnumeration(props.keys()); | |
return Maps.toMap(keysIter, props::get); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment