Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-370

Add method MapUtils.putIfNotNull

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • 3.2
    • None
    • Map
    • None

    Description

      Add method MapUtils.putIfNotNull that adds the given value to the map only if it is not null.

      Possible implementation:

      public static <K, V> void putIfNotNull(Map<K, V> map, K key, V value) {
      if (value != null)

      { map.put(key, value); }

      }

      Attachments

        1. COLLECTIONS-370.patch
          2 kB
          Tomofumi Kitano

        Activity

          People

            Unassigned Unassigned
            tompasik Tom Pasierb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: