Search in sources :

Example 1 with UByte

use of org.jooq.types.UByte 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);
        }
    });
}
Also used : UInteger(org.jooq.types.UInteger) UShort(org.jooq.types.UShort) ULong(org.jooq.types.ULong) UShort(org.jooq.types.UShort) UByte(org.jooq.types.UByte) UInteger(org.jooq.types.UInteger) BigInteger(java.math.BigInteger) JSONObject(org.jooq.tools.json.JSONObject) UByte(org.jooq.types.UByte) ULong(org.jooq.types.ULong) BigInteger(java.math.BigInteger) JSONParser(org.jooq.tools.json.JSONParser)

Aggregations

BigInteger (java.math.BigInteger)1 JSONObject (org.jooq.tools.json.JSONObject)1 JSONParser (org.jooq.tools.json.JSONParser)1 UByte (org.jooq.types.UByte)1 UInteger (org.jooq.types.UInteger)1 ULong (org.jooq.types.ULong)1 UShort (org.jooq.types.UShort)1