org.bidib.jbidibc.netbidib.pairingstore.ProtocolVersionSerializer Maven / Gradle / Ivy
package org.bidib.jbidibc.netbidib.pairingstore;
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 ProtocolVersionSerializer extends StdSerializer {
private static final long serialVersionUID = 1L;
public ProtocolVersionSerializer() {
this(null);
}
public ProtocolVersionSerializer(Class t) {
super(t);
}
@Override
public void serialize(PairingStoreProtocolVersion value, JsonGenerator jgen, SerializerProvider provider)
throws IOException {
jgen.writeString(String.format("%1$d.%2$d", value.getMajorVersion(), value.getMinorVersion()));
}
}