Skip to content

Commit

Permalink
Add a toMap method to JSONObject, returned map is immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Mar 18, 2020
1 parent 13d0f2f commit 1db001c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/codehaus/jettison/json/JSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -1385,4 +1385,8 @@ public boolean isEscapeForwardSlashAlways() {
public void setEscapeForwardSlashAlways(boolean escapeForwardSlashAlways) {
this.escapeForwardSlashAlways = escapeForwardSlashAlways;
}

public Map toMap() {
return Collections.unmodifiableMap(myHashMap);
}
}

0 comments on commit 1db001c

Please sign in to comment.