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

com.instaclustr.jackson.JMXServiceURLSerializer Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.instaclustr.jackson;

import javax.management.remote.JMXServiceURL;
import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;

public class JMXServiceURLSerializer extends StdSerializer {

    public JMXServiceURLSerializer() {
        this(null);
    }

    public JMXServiceURLSerializer(Class t) {
        super(t);
    }

    @Override
    public void serialize(JMXServiceURL value, JsonGenerator gen, SerializerProvider provider) throws IOException {
        if (value != null) {
            gen.writeString(value.toString());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy