public class FastJson2Utils extends Object
| 构造器和说明 |
|---|
FastJson2Utils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
parse(byte[] input,
Class<T> type) |
static <T> T |
parse(String jsonString,
Class<T> type) |
static com.alibaba.fastjson2.JSONArray |
parseArray(byte[] input) |
static <T> List<T> |
parseArray(byte[] input,
Class<T> clazz) |
static com.alibaba.fastjson2.JSONArray |
parseArray(String jsonString) |
static <T> List<T> |
parseArray(String jsonString,
Class<T> clazz) |
static com.alibaba.fastjson2.JSONObject |
parseObject(byte[] bytes) |
static com.alibaba.fastjson2.JSONObject |
parseObject(String bodyString) |
static <K,V> List<Map<K,V>> |
parseToListMap(String stringValue,
Class<K> kType,
Class<V> vType) |
static String |
toJson(Object object) |
static String |
toJson(Object input,
com.alibaba.fastjson2.JSONWriter.Feature... features)
支持传入更多 SerializerFeature
例如:
SerializerFeature.WriteMapNullValue 支持对 null 值字段的转换
|
static byte[] |
toJSONBytes(Object input) |
static byte[] |
toJSONBytes(Object input,
com.alibaba.fastjson2.JSONWriter.Feature... features) |
public static byte[] toJSONBytes(Object input)
public static String toJson(Object input, com.alibaba.fastjson2.JSONWriter.Feature... features)
例如: SerializerFeature.WriteMapNullValue 支持对 null 值字段的转换
public static byte[] toJSONBytes(Object input, com.alibaba.fastjson2.JSONWriter.Feature... features)
public static <T> T parse(byte[] input,
Class<T> type)
public static com.alibaba.fastjson2.JSONObject parseObject(String bodyString)
public static com.alibaba.fastjson2.JSONObject parseObject(byte[] bytes)
public static com.alibaba.fastjson2.JSONArray parseArray(String jsonString)
public static com.alibaba.fastjson2.JSONArray parseArray(byte[] input)
Copyright © 2024. All rights reserved.