private Optional<Condition> convertMatchNull(final Field<?> field,
                                                 final Boolean matchNull,
                                                 final Optional<Condition> condition) {
        if (matchNull == null) {
            return condition;
        }
        if (matchNull) {
            return condition.map(c -> c.or(field.isNull())).or(() -> Optional.of(field.isNull()));
        }
        return condition.or(() -> Optional.of(field.isNotNull()));
    }
Used to build jOOQ conditions from string criteria

@param field    The jOOQ field being queried
@param criteria The criteria to apply
@return A condition that applies the given criteria
stroom-db-util/src/main/java/stroom/db/util/JooqHelper.java