All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.litongjava.tio.utils.json.JsonUtils Maven / Gradle / Ivy

There is a newer version: 3.7.3.v202400213-RELEASE
Show newest version
package com.litongjava.tio.utils.json;

import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;

public class JsonUtils {

  public static String toJson(Object object) {
    return Json.getJson().toJson(object);
  }

  public static byte[] toJsonBytes(Object object) {
    return Json.getJson().toJsonBytes(object);
  }

  public static  T parse(String body, Class type) {
    return Json.getJson().parse(body, type);
  }

  public static Object parseObject(String jsonString) {
    return Json.getJson().parseObject(jsonString);
  }

  public static Object parseArray(String jsonString) {
    return Json.getJson().parseArray(jsonString);
  }

  public static Map parseToMap(String json) {
    return Json.getJson().parseToMap(json);
  }

  public static  Map parseToMap(String json, Class kType, Class vType) {
    return Json.getJson().parseToMap(json, kType, vType);
  }

  public static  List> parseToListMap(String json, Class kType, Class vType) {
    return Json.getJson().parseToListMap(json, kType, vType);
  }

  public static  T parse(String bodyString, Type type) {
    return Json.getJson().parse(bodyString, type);
  }

  public static  T parse(byte[] body, Type type) {
    return Json.getJson().parse(body, type);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy