Is there are any possible way to add constraints to the elements of List? For example I have a command which accept List and I want add constraints on this elements, for example on size.
How to do that?
Thank you.
Code:
class SongCommand {
String title
List<String> couplet
List<String> chorus
Boolean isChorus
Boolean isChorusRepeat
static constraints = {
title(blank: false, maxSize: 6)
isChorus(blank: true)
}
}
How to do that?
Thank you.