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

com.github.t9t.jooq.json.JsonConverter 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 JsonConverter implements Converter {
    @Override
    public Json from(Object t) {
        return t == null ? null : Json.of(t.toString());
    }

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

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

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