
com.databasesandlife.util.jooq.MySqlBooleanConverter Maven / Gradle / Ivy
package com.databasesandlife.util.jooq;
import org.jooq.Converter;
@SuppressWarnings({ "serial" })
public class MySqlBooleanConverter implements Converter {
@Override public Class fromType() { return Byte.class; }
@Override public Class toType() { return Boolean.class; }
@Override
public Boolean from(Byte x) {
if (x == null) return null;
if (x == (byte)0) return false;
return true;
}
@Override
public Byte to(Boolean m) {
if (m == null) return null;
return m ? (byte)1 : 0;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy