groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Boekhold <boekh...@gmx.com>
Subject Re: Check if List is of specific size and elements of specific type
Date Tue, 29 Mar 2016 12:29:59 GMT
Him

Thanks all for the response, this works fine. Only draw-back is that 
IntelliJ gives a warning about incompatible types. Almost as if it 
doesn't understand the spread operator...

Maarten

On 2016-03-29 14:29, Marcos Carceles wrote:
> Would this work?
>
> listVariable*.class == [Integer, Integer]
>
> On 29 March 2016 at 12:25, Maarten Boekhold <boekhold@gmx.com 
> <mailto:boekhold@gmx.com>> wrote:
>
>     Hi,
>
>     Is there a quick and easy way to do something like:
>
>     assert listVariable == [int, int]
>
>     eg, the list is of size 2 and each element is an int?
>
>     Maarten
>
>


Mime
View raw message