X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Futil%2FLangUtils.java;fp=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Futil%2FLangUtils.java;h=36bec240e83601aedd915a342f377b5aef89b1d4;hb=74595e8270dcca6c4f9cfbded8e37d7b4300b2bd;hp=16229453776e04ed968457183aa225fd578d6c0a;hpb=4d2d8d8003f6b2afb2f207a1aa7bb205929559aa;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/util/LangUtils.java b/org.argeo.util/src/org/argeo/util/LangUtils.java index 162294537..36bec240e 100644 --- a/org.argeo.util/src/org/argeo/util/LangUtils.java +++ b/org.argeo.util/src/org/argeo/util/LangUtils.java @@ -11,6 +11,7 @@ import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.time.temporal.Temporal; import java.util.ArrayList; +import java.util.Collections; import java.util.Dictionary; import java.util.Enumeration; import java.util.HashMap; @@ -38,20 +39,23 @@ 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 map(String key, Object value) { - assert key != null; - HashMap props = new HashMap<>(); - if (value != null) - props.put(key, value); - return props; - } +// /* +// * MAP +// */ +// /** +// * Creates a new {@link Map} with one key-value pair. Key should not be null, +// * but if the value is null, it returns an empty {@link Map}. +// * +// * @deprecated Use {@link Collections#singletonMap(Object, Object)} instead. +// */ +// @Deprecated +// public static Map map(String key, Object value) { +// assert key != null; +// HashMap props = new HashMap<>(); +// if (value != null) +// props.put(key, value); +// return props; +// } /* * DICTIONARY