Join Slack
Powered by
I basically want to validate composite unique cons...
# announcements
b
Bernhard
12/04/2018, 12:43 PM
I basically want to validate composite unique constraints
j
Joris PZ
12/04/2018, 12:44 PM
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/distinct-by.html
Joris PZ
12/04/2018, 12:44 PM
Well that would get you the unique values at least
b
Bernhard
12/04/2018, 12:44 PM
and then I suppose compare the size
j
Joris PZ
12/04/2018, 12:45 PM
Yes, that would work
Joris PZ
12/04/2018, 12:46 PM
Would be nicer if it would short-circuit on the first non-unique item somehow, but I don't think there's a standard function for that
b
Bernhard
12/04/2018, 12:46 PM
or duplicatesBy() 🙂
7
Views
Open in Slack
Previous
Next