是否存在静态Groovy呼叫操作符?

是否存在静态Groovy呼叫操作符?,groovy,Groovy,我知道我可以为Groovy类创建一个调用操作符,如下所示: class MyCallable { int call(int x) { 2*x } } def mc = new MyCallable() assert mc(2) == 4 class MyStaticCallable { static int call(int x) { 2*x } } assert MyStatic

我知道我可以为Groovy类创建一个调用操作符,如下所示:

class MyCallable {
    int call(int x) {           
        2*x
    }
}

def mc = new MyCallable()
assert mc(2) == 4 
class MyStaticCallable {
    static int call(int x) {           
        2*x
    }
}

assert MyStaticCallable(2) == 4 
但是我可以创建一个静态调用方法吗

class MyStaticCallable {
    static int call(int x) {           
        2*x
    }
}

assert MyStaticCallable(2) == 4 
非常感谢您的帮助

不,你必须这么做

class MyStaticCallable {
    static int call(int x) {           
        2*x
    }
}

assert MyStaticCallable(2) == 4 
MyStaticCallable.call(2)

非常感谢@tim_yates!最后,我用
导入静态文件
来伪装它。