Improve CMS UI framework.
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / util / LangUtils.java
index 2f99bb3e0d735bb75a99704ce9ffbee2847b560c..1a7a8815e262dd94e5d53becd48370665a36662a 100644 (file)
@@ -35,6 +35,21 @@ public class LangUtils {
                return res;
        }
 
+       /*
+        * MAP
+        */
+       /**
+        * Creates a new {@link Dictionary} with one key-value pair. Key should not be
+        * null, but if the value is null, it returns an empty {@link Dictionary}.
+        */
+       public static Map<String, Object> map(String key, Object value) {
+               assert key != null;
+               HashMap<String, Object> props = new HashMap<>();
+               if (value != null)
+                       props.put(key, value);
+               return props;
+       }
+
        /*
         * DICTIONARY
         */