(coll) A SimpleMap interface, which java.util.Map should implement

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Not an Issue
    • Priority: P5
    • None
    • Affects Version/s: 1.4.2
    • Component/s: core-libs



      Name: jl125535 Date: 07/27/2004


      A DESCRIPTION OF THE REQUEST :
      I want a new interface, SimpleMap, and that java.util.Map
      is retrofitted to implement this new interface. I think SimpleMap should
      only contain two methods: get and containsKey.


      JUSTIFICATION :
      In some cases I feel the need for a simple standardized read-only
      interface for a map, and java.util.Map is really too complex
      (even if you exclude the "optional" methods).


      CUSTOMER SUBMITTED WORKAROUND :
      * Implement the existing java.utl.Map interface and leave most methods inimplemented, throwing java.lang.UnsupportedOperationException. However, doing so for methods not marked as "optional" violates the contract for the java.util.Map interface.

      * Create your own SimpleMap interface. However, this causes more work with wrapper classes since you cannot use an java.util.Map as a SimpleMap.
      (Incident Review ID: 229714)
      ======================================================================

            Assignee:
            Martin Buchholz
            Reporter:
            Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: