|
|
@@ -12,7 +12,7 @@ public class MapUtil { |
|
|
|
private MapUtil() {} |
|
|
|
|
|
|
|
public static String readString(Map map, String name) { |
|
|
|
return readString(map, name, null); |
|
|
|
return readString(map, name, ""); |
|
|
|
} |
|
|
|
|
|
|
|
public static String readString(Map map, String name, String defaultValue) { |
|
|
@@ -25,11 +25,11 @@ public class MapUtil { |
|
|
|
return defaultValue; |
|
|
|
} |
|
|
|
|
|
|
|
public static Long readLong(Map map, String name) { |
|
|
|
return readLong(map, name, null); |
|
|
|
public static long readLong(Map map, String name) { |
|
|
|
return readLong(map, name, 0L); |
|
|
|
} |
|
|
|
|
|
|
|
public static Long readLong(Map map, String name, Long defaultValue) { |
|
|
|
public static long readLong(Map map, String name, Long defaultValue) { |
|
|
|
Object s = map.get(name); |
|
|
|
|
|
|
|
if (s != null) { |
|
|
@@ -109,11 +109,11 @@ public class MapUtil { |
|
|
|
return defaultValue; |
|
|
|
} |
|
|
|
|
|
|
|
public static Integer readInt(Map map, String name) { |
|
|
|
return readInt(map, name, null); |
|
|
|
public static int readInt(Map map, String name) { |
|
|
|
return readInt(map, name, 0); |
|
|
|
} |
|
|
|
|
|
|
|
public static Integer readInt(Map map, String name, Integer defaultValue) { |
|
|
|
public static int readInt(Map map, String name, int defaultValue) { |
|
|
|
Object s = map.get(name); |
|
|
|
|
|
|
|
if (s != null) { |
|
|
@@ -130,11 +130,11 @@ public class MapUtil { |
|
|
|
return defaultValue; |
|
|
|
} |
|
|
|
|
|
|
|
public static Float readFloat(Map map, String name) { |
|
|
|
return readFloat(map, name, null); |
|
|
|
public static float readFloat(Map map, String name) { |
|
|
|
return readFloat(map, name, 0.0F); |
|
|
|
} |
|
|
|
|
|
|
|
public static Float readFloat(Map map, String name, Float defaultValue) { |
|
|
|
public static float readFloat(Map map, String name, float defaultValue) { |
|
|
|
Object s = map.get(name); |
|
|
|
|
|
|
|
if (s != null) { |
|
|
@@ -151,11 +151,11 @@ public class MapUtil { |
|
|
|
return defaultValue; |
|
|
|
} |
|
|
|
|
|
|
|
public static Double readDouble(Map map, String name) { |
|
|
|
return readDouble(map, name, null); |
|
|
|
public static double readDouble(Map map, String name) { |
|
|
|
return readDouble(map, name, 0d); |
|
|
|
} |
|
|
|
|
|
|
|
public static Double readDouble(Map map, String name, Double defaultValue) { |
|
|
|
public static double readDouble(Map map, String name, double defaultValue) { |
|
|
|
Object s = map.get(name); |
|
|
|
|
|
|
|
if (s != null) { |
|
|
@@ -172,11 +172,11 @@ public class MapUtil { |
|
|
|
return defaultValue; |
|
|
|
} |
|
|
|
|
|
|
|
public static Boolean readBool(Map map, String name) { |
|
|
|
public static boolean readBool(Map map, String name) { |
|
|
|
return readBool(map, name, false); |
|
|
|
} |
|
|
|
|
|
|
|
public static Boolean readBool(Map map, String name, Boolean defaultValue) { |
|
|
|
public static boolean readBool(Map map, String name, boolean defaultValue) { |
|
|
|
Object s = map.get(name); |
|
|
|
|
|
|
|
if (s != null) { |
|
|
|