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

io.gitee.huangguiming.Imcode.utils.GsonParser Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package io.gitee.huangguiming.Imcode.utils;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonReader;

import java.io.Reader;

public class GsonParser {
  private static final JsonParser JSON_PARSER = new JsonParser();

  public static JsonObject parse(String json) {
    return JSON_PARSER.parse(json).getAsJsonObject();
  }

  public static JsonObject parse(Reader json) {
    return JSON_PARSER.parse(json).getAsJsonObject();
  }

  public static JsonObject parse(JsonReader json) {
    return JSON_PARSER.parse(json).getAsJsonObject();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy