The best way to pass optional clause arguments starting from jOOQ 3.17 is to pass DSL::noField. Unfortunately, this doesn't seem to work yet for SEEK, which I'll fix right away:
After that fix, you'll write:
ctx.selectFrom(EXAMPLE)
.seek(
condition ? noField(EXAMPLE.CREATED_AT) : c,
.limit(limit)
.fetch();
A workaround is what you did, or you can always access the underlying mutable SelectQuery object via SelectFinalStep::getQuery, which allows for constructing the query a bit more imperatively (or you start out this way via DSLContext::selectQuery).
I'd keep your Optional approach for now, and migrate to using noField() after the above fix.
Best Regards,
Lukas