com.capitalone.dashboard.mapper.CustomObjectMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-audit Show documentation
Show all versions of api-audit Show documentation
Hygieia Audit Rest API Layer
package com.capitalone.dashboard.mapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.bson.types.ObjectId;
/**
* Custom object mapper that knows how to serialize Mongo ObjectIds.
*/
public class CustomObjectMapper extends ObjectMapper {
private static final long serialVersionUID = 2035695746790240402L;
public CustomObjectMapper() {
SimpleModule module = new SimpleModule("ObjectIdModule");
module.addSerializer(ObjectId.class, new ObjectIdSerializer());
this.registerModule(module);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy