groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: Calling a static method by packagename.method
Date Fri, 08 Apr 2016 07:32:46 GMT


On 07.04.2016 19:15, emmanuel r wrote:
> You can do this:
>
> import static org.matz.utils.Jira.*
> import org.matz.utils.Jira
>
> Jira.createTicket()
> createTicket()

or if a small case jira is wanted:

import org.matz.utils.Jira as jira

> Note: Methods are /always/ in a class. Most likely Groovy is creating a
> Script class for you.

yepp, always! In case of a script, the name is generated from the script 
name.

bye Jochen


Mime
View raw message