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

com.github.t9t.jooq.json.JsonbConverter Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
package com.github.t9t.jooq.json;

import org.jooq.Converter;

public class JsonbConverter implements Converter {
    @Override
    public Jsonb from(Object t) {
        return t == null ? null : Jsonb.of(t.toString());
    }

    @Override
    public String to(Jsonb u) {
        return u == null ? null : u.getValue();
    }

    @Override
    public Class fromType() {
        return Object.class;
    }

    @Override
    public Class toType() {
        return Jsonb.class;
    }
}