use of org.jooq.tools.json.JSONObject in project SimpleFlatMapper by arnaudroger.
the class JooqConverterFactoryProducer method produce.
@Override
public void produce(Consumer<? super ConverterFactory<?, ?>> consumer) {
this.constantConverter(consumer, byte.class, UByte.class, new Converter<Byte, UByte>() {
@Override
public UByte convert(Byte in) throws Exception {
if (in == null) {
return null;
}
return UByte.valueOf(in);
}
});
this.constantConverter(consumer, short.class, UByte.class, new Converter<Short, UByte>() {
@Override
public UByte convert(Short in) throws Exception {
if (in == null) {
return null;
}
return UByte.valueOf(in);
}
});
this.constantConverter(consumer, int.class, UByte.class, new Converter<Integer, UByte>() {
@Override
public UByte convert(Integer in) throws Exception {
if (in == null) {
return null;
}
return UByte.valueOf(in);
}
});
this.constantConverter(consumer, long.class, UByte.class, new Converter<Long, UByte>() {
@Override
public UByte convert(Long in) throws Exception {
if (in == null) {
return null;
}
return UByte.valueOf(in);
}
});
this.constantConverter(consumer, short.class, UShort.class, new Converter<Short, UShort>() {
@Override
public UShort convert(Short in) throws Exception {
if (in == null) {
return null;
}
return UShort.valueOf(in);
}
});
this.constantConverter(consumer, int.class, UShort.class, new Converter<Integer, UShort>() {
@Override
public UShort convert(Integer in) throws Exception {
if (in == null) {
return null;
}
return UShort.valueOf(in);
}
});
this.constantConverter(consumer, int.class, UInteger.class, new Converter<Integer, UInteger>() {
@Override
public UInteger convert(Integer in) throws Exception {
if (in == null) {
return null;
}
return UInteger.valueOf(in);
}
});
this.constantConverter(consumer, long.class, UInteger.class, new Converter<Long, UInteger>() {
@Override
public UInteger convert(Long in) throws Exception {
if (in == null) {
return null;
}
return UInteger.valueOf(in);
}
});
this.constantConverter(consumer, long.class, ULong.class, new Converter<Long, ULong>() {
@Override
public ULong convert(Long in) throws Exception {
if (in == null) {
return null;
}
return ULong.valueOf(in);
}
});
this.constantConverter(consumer, BigInteger.class, ULong.class, new Converter<BigInteger, ULong>() {
@Override
public ULong convert(BigInteger in) throws Exception {
if (in == null) {
return null;
}
return ULong.valueOf(in);
}
});
this.constantConverter(consumer, String.class, JSONObject.class, new Converter<String, JSONObject>() {
@Override
public JSONObject convert(String in) throws Exception {
if (in == null) {
return null;
}
JSONParser parser = new JSONParser();
return (JSONObject) parser.parse(in);
}
});
}
Aggregations