|
1 | | -/* |
2 | | - * KINGSTAR MEDIA SOLUTIONS Co.,LTD. Copyright c 2005-2013. All rights reserved. |
3 | | - * |
4 | | - * This source code is the property of KINGSTAR MEDIA SOLUTIONS LTD. It is intended |
5 | | - * only for the use of KINGSTAR MEDIA application development. Reengineering, reproduction |
6 | | - * arose from modification of the original source, or other redistribution of this source |
7 | | - * is not permitted without written permission of the KINGSTAR MEDIA SOLUTIONS LTD. |
8 | | - */ |
9 | 1 | package me.chanjar.weixin.common.util.json; |
10 | 2 |
|
11 | | - |
12 | 3 | import com.google.common.collect.Lists; |
13 | 4 | import com.google.gson.JsonArray; |
14 | 5 | import com.google.gson.JsonElement; |
15 | 6 | import com.google.gson.JsonObject; |
16 | 7 |
|
17 | 8 | import java.util.List; |
18 | 9 |
|
19 | | - |
20 | 10 | public class GsonHelper { |
21 | 11 |
|
22 | 12 | public static boolean isNull(JsonElement element) { |
@@ -95,7 +85,7 @@ public static Boolean getAsBoolean(JsonElement element) { |
95 | 85 |
|
96 | 86 | public static boolean getAsPrimitiveBool(JsonElement element) { |
97 | 87 | Boolean r = getAsBoolean(element); |
98 | | - return r != null && r.booleanValue(); |
| 88 | + return r != null && r; |
99 | 89 | } |
100 | 90 |
|
101 | 91 | public static Double getAsDouble(JsonElement element) { |
@@ -129,6 +119,7 @@ public static Integer[] getIntArray(JsonObject o, String string) { |
129 | 119 |
|
130 | 120 | return result.toArray(new Integer[0]); |
131 | 121 | } |
| 122 | + |
132 | 123 | public static String[] getStringArray(JsonObject o, String string) { |
133 | 124 | JsonArray jsonArray = getAsJsonArray(o.getAsJsonArray(string)); |
134 | 125 | if (jsonArray == null) { |
|
0 commit comments