Groovy web console

subscribe to the feed Subscribe
to this
site

matozmysel?

Published 4 months ago by JZ
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
class Foo {    String baz

    static Foo create(String foo) {
        return new Foo(baz: 'String FOO')
    }

    static Foo create(Integer foo) {
        return new Foo(baz: 'integer FOO')
    }

    //static Foo create(Object foo) {
    //    return new Foo(baz: 'object FOO')
    //}
}

Foo.create(false).baz