From c7bfe4beb73d3020ed94b620844dbb400a33bd81 Mon Sep 17 00:00:00 2001 From: "David E. Jones" Date: Sun, 26 Aug 2007 01:01:58 +0000 Subject: [PATCH] Added little method like the addToDoubleInMap to do addToListInMap git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@569749 13f79535-47bb-0310-9956-ffa450edef68 --- .../base/src/base/org/ofbiz/base/util/UtilMisc.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java b/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java index d8fd6a8de2..9e78eaf7bb 100644 --- a/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java +++ b/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java @@ -350,6 +350,15 @@ public class UtilMisc { return list; } + public static void addToListInMap(Object element, Map theMap, Object listKey) { + List theList = (List) theMap.get(listKey); + if (theList == null) { + theList = FastList.newInstance(); + theMap.put(listKey, theList); + } + theList.add(element); + } + public static long toLong(Object value) { if (value != null) { if (value instanceof Long) {