Code example for Currency

Methods: toString

0
class CurrencyConverter implements JsonSerializer<Currency>, JsonDeserializer<Currency>
{ 
	@Override 
	public JsonElement serialize(Currency src, Type srcType, JsonSerializationContext context)
	{ 
		return new JsonPrimitive(src.toString());
	} 
 
	@Override 
	public Currency deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException
	{ 
		return Currency.getInstance(json.getAsString());
	} 
}