Code example for GsonBuilder

Methods: create

0
	public static<S> String mapToApi(S s, BasePojoApiMap<S> apiMap) {
		GsonBuilder gb = BaseApiPojo.getDefaultBuilder();
		if (null != apiMap) {
			gb = apiMap.extendBuilder(gb);
		} 
		return gb.create().toJson(s);
	} 
	public static<S> S mapFromApi(String s, Class<S> type, BasePojoApiMap<S> apiMap) {
		GsonBuilder gb = BaseApiPojo.getDefaultBuilder();
		if (null != apiMap) {
			gb = apiMap.extendBuilder(gb);
		} 
		return gb.create().fromJson(s, type);
	} 
	public static<S> S mapFromApi(JsonElement j, Class<S> type, BasePojoApiMap<S> apiMap) {
		GsonBuilder gb = BaseApiPojo.getDefaultBuilder();
		if (null != apiMap) {
			gb = apiMap.extendBuilder(gb);
		} 
		return gb.create().fromJson(j, type);
Connect your IDE to all the code out there  Get Codota for Java