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

uk.gov.service.payments.commons.api.json.ExternalMetadataSerialiser Maven / Gradle / Ivy

There is a newer version: 1.0.20241216100655
Show newest version
package uk.gov.service.payments.commons.api.json;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import uk.gov.service.payments.commons.model.charge.ExternalMetadata;

import java.io.IOException;

@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
public class ExternalMetadataSerialiser extends StdSerializer {

    public ExternalMetadataSerialiser() {
        this(null);
    }

    private ExternalMetadataSerialiser(Class t) {
        super(t);
    }

    @Override
    public void serialize(ExternalMetadata externalMetadata, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        serializerProvider.defaultSerializeValue(externalMetadata.getMetadata(), jsonGenerator);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy