From 92f98eff5f978cb2dbcd88c4ed19adf9cdc295cd Mon Sep 17 00:00:00 2001 From: Redkale <22250530@qq.com> Date: Wed, 15 Feb 2017 09:57:10 +0800 Subject: [PATCH] --- src/org/redkale/util/Utility.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/org/redkale/util/Utility.java b/src/org/redkale/util/Utility.java index 3991b3383..014d68ecf 100644 --- a/src/org/redkale/util/Utility.java +++ b/src/org/redkale/util/Utility.java @@ -85,7 +85,8 @@ public final class Utility { private Utility() { } - public static HashMap asMap(String... items) { + // 类似 JDK9中的 Map.of 方法 + public static Map ofMap(String... items) { HashMap map = new HashMap<>(); int len = items.length / 2; for (int i = 0; i < len; i++) { @@ -94,7 +95,8 @@ public final class Utility { return map; } - public static HashMap asMap(Object... items) { + // 类似 JDK9中的 Map.of 方法 + public static Map ofMap(Object... items) { HashMap map = new HashMap<>(); int len = items.length / 2; for (int i = 0; i < len; i++) {