private static Predicate<Enum<?>> enumValueMatches(String name, BiPredicate<String, String> comparer) {
            return e -> Optional.ofNullable(
                Unchecked.function(e.getDeclaringClass()::getField)
                    .apply(e.name())
                    .getAnnotation(DatabaseValue.class))
                .map(DatabaseValue::value)
                .map(dbName -> comparer.test(dbName, name))
                .orElseGet(() -> comparer.test(e.name(), name));
        }
Map database integer values to enum ordinal values.

@param <E> the enum type to map
@param type the enum type to map
@return an enum mapper that matches on {@link Enum#ordinal()}
core/src/main/java/org/jdbi/v3/core/mapper/EnumMapper.java