com.twilio.sdk.converter.CurrencyDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio-java-sdk Show documentation
Show all versions of twilio-java-sdk Show documentation
Release Candidate for Next-Gen Twilio Java Helper Library
The newest version!
package com.twilio.sdk.converter;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import java.io.IOException;
import java.util.Currency;
public class CurrencyDeserializer extends JsonDeserializer {
@Override
public Currency deserialize(JsonParser jsonParser,
DeserializationContext deserializationContext) throws IOException {
String currencyCode = jsonParser.readValueAs(String.class);
return Currency.getInstance(currencyCode.toUpperCase());
}
}