All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uk.gov.service.payments.commons.model.SupportedLanguageJsonDeserializer Maven / Gradle / Ivy

There is a newer version: 1.0.20241120144934
Show newest version
package uk.gov.service.payments.commons.model;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

import java.io.IOException;

public final class SupportedLanguageJsonDeserializer extends JsonDeserializer {
    @Override
    public SupportedLanguage deserialize(final JsonParser parser, final DeserializationContext context) throws IOException {
        final String valueAsString = parser.getValueAsString();
        return SupportedLanguage.fromIso639AlphaTwoCode(valueAsString);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy