I have a map, I am wondering if there is a way to get some submap according to some condition. Any useful library?
To retrieve the set of keys from HashMap, use the keyset() method. However, for set of values, use the values() method.
Method 1: Print Map in Java Using for-each Loop Within the for-each loop, you can use Map's getValue() and getKey() methods to iterate over key-value pairs. This is the most systematic way to print a map and should be used if it is required to print both map keys and values.
Create a submap by using the Graphical Data Mapping editor. Create a submap by defining a Submap transform between an input object and an output object in a message map. Use the Graphical Data Mapping editor to convert a local map into a submap by using the Refactor to submap function.
In Guava the Maps
class contains three different filtering methods, depending on whether you want to filter by key, value, or both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With