How does the Groovy in operator work?

前端 未结 3 1486
花落未央
花落未央 2021-01-11 10:22

The Groovy \"in\" operator seems to mean different things in different cases. Sometimes x in y means y.contains(x) and sometimes it seems to call

3条回答
  •  孤城傲影
    2021-01-11 10:54

    It's actually all based on isCase. Groovy adds an isCase method to Collections that is based on the contains method. Any class with isCase can be used with in.

提交回复
热议问题