Task Summary
Find all instances of positional User constructor and replace them with a .tap() based equivalent.
Context
Currently the jOOq table User is constructed like this when used:
val GUEST: User =
new User(null, "guest", null, null, null, null, UserRoleEnum.REGULAR, null, null, null, null)
This means whenever we change the jOOq definition we have to find all instances of this constructor and add / remove params even if they aren't needed. It's also just hard to read.
Instead, we could be using Scala's tap system which allows us to construct and setup an object in one pass. This is also considered more idiomatic Scala.
val GUEST: User = {
new User().tap { user =>
user.setName("guest")
user.setRole(UserRoleEnum.REGULAR)
}
}
Task Type
Task Summary
Find all instances of positional User constructor and replace them with a .tap() based equivalent.
Context
Currently the jOOq table User is constructed like this when used:
This means whenever we change the jOOq definition we have to find all instances of this constructor and add / remove params even if they aren't needed. It's also just hard to read.
Instead, we could be using Scala's tap system which allows us to construct and setup an object in one pass. This is also considered more idiomatic Scala.
Task Type