Class OkkamMaps


  • public class OkkamMaps
    extends Object
    • Method Detail

      • valuesToList

        public static <V> List<V> valuesToList​(Map<?,​V> map)
        Return the list composed by the values of the map.
        Type Parameters:
        V - The map value type
        Parameters:
        map - The input map
        Returns:
        The List composed by the value set of the map
      • putIfNotExists

        public static <K,​V> Map<K,​V> putIfNotExists​(Map<K,​V> map,
                                                                K key,
                                                                V value)
        Put an element into the map if it the key does not exists.
        Type Parameters:
        K - The map key type
        V - The map value type
        Parameters:
        map - The map
        key - The key
        value - The value
        Returns:
        The input map