开发者

What do Groovy assertions look like with parentheses?

The example on this page only shows Groovy assertion开发者_开发问答s without parentheses.

assert a != null, 'First parameter must not be null'

What would this look like if I wanted to include the parentheses? I presume that this is the closest equivalent to Perl's die() function (print error message and exit in one statement)?


The answer is:

assert(a != null), "First parameter must not be null"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜