groostav
10/25/2024, 4:15 AMprivate val staticValidations = ContextFreeMessageValidator().apply {
addValidation<AnchorLocationDTO> {
require(it.occurance >= 1) { "Must have positive occurrence" }
}
and maybe a few dozen more such validations.
but what if I wrote a slick DSL:
private val dslTest = contextFreeMessageValidator {
+ { message: AnchorLocationDTO ->
require(message.occurance >= 1) { "Must have positive occurrence" }
}
}
its so pretty... but no... I must resist, nobody else on my project will have any idea wtf thats doing...Fergus Hewson
10/25/2024, 4:56 AMJavier
10/25/2024, 8:14 AMchristophsturm
10/25/2024, 9:05 AM