Code example for JsonPrimitive

Methods: getAsNumberisBooleanisNumber

0
		return (T)parse(element.getAsJsonObject());
	} 
	 
	@SuppressWarnings("unchecked") 
	private <T> T parse(JsonPrimitive element){
		if(element.isBoolean()) return (T) deserializer.fromJson(element, Boolean.class);
		if(element.isNumber()) return (T) element.getAsNumber();
		if(element.isString()) return (T) deserializer.fromJson(element, String.class);
		return null; 
	} 
	 
	@SuppressWarnings("unchecked") 
	private <T> T parse(JsonArray element){
		//String className = cleanClassName(element.get(element.size()-1)); 
		return (T) deserializer.fromJson(element, Collection.class);
	} 
	 
	@SuppressWarnings("unchecked") 
	private <T> T parse(JsonObject element){
		String className = cleanClassName(element.remove("class"));