com.twilio.converter.CurrencyDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio Show documentation
Show all versions of twilio Show documentation
Twilio Java Helper Library
package com.twilio.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());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy