8 Replies Latest reply: Mar 18, 2012 9:46 PM by 858257 RSS

    Create Immutable HashMap

      Hello - I have a situation where in I need to send a hashmap as an argument to another method. And I do not have any control over this other method and I have to make sure that the HashMap I am passing should not be updated.

      I could have used Collections.unModifiableMap() to a get an unmodifiableMap but, the I need to specifically pass HashMap and not just any Map.

      Please let me know how to achieve this.