I am writing a custom serializer to convert double values into strings in JSON objects. My code so far:
public String toJson(Object obj) throws IOException {
You can register the JsonSerializer for the primitive type double.
JsonSerializer
double
module.addSerializer(double.class, new DoubleSerializer());