This commit is contained in:
Lukas Eder 2021-04-29 12:38:35 +02:00
parent 8cc5469e98
commit efbd7866f3
2 changed files with 6 additions and 4 deletions

View File

@ -37,6 +37,7 @@
*/
package org.jooq;
import static org.jooq.Converters.notImplemented;
import static org.jooq.Converters.nullable;
import java.io.Serializable;
@ -340,8 +341,4 @@ public interface Converter<T, U> extends Serializable {
) {
return of(fromType, toType, notImplemented(), nullable(to));
}
private static <T, U> Function<T, U> notImplemented() {
return t -> { throw new DataTypeException("Conversion function not implemented"); };
}
}

View File

@ -43,6 +43,7 @@ import static org.jooq.tools.Convert.convertArray;
import java.io.Serializable;
import java.util.function.Function;
import org.jooq.exception.DataTypeException;
import org.jooq.impl.AbstractConverter;
import org.jooq.impl.IdentityConverter;
import org.jooq.impl.SQLDataType;
@ -225,4 +226,8 @@ public class Converters<T, U> extends AbstractConverter<T, U> {
? (Function<T, U> & Serializable) t -> t == null ? null
: f.apply(t) : t -> t == null ? null : f.apply(t);
}
static final <T, U> Function<T, U> notImplemented() {
return t -> { throw new DataTypeException("Conversion function not implemented"); };
}
}