Groovy web console

subscribe to the feed Subscribe
to this
site
idea (via #groovywebconsole)
tweet this snippet Tweet
this
script

idea

Published 7 months ago by dean
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
Object someResult
ArrayList objects = [object1,object2,object3]
ArrayList objectAccessors = ['obj1','obj2','obj3']
ArrayList methods = []
(objects.size()).times{
    methods.add("$objectAccessors[it]*.buckets*.")
}
String functionCall = methods.join()
someResult.'$functionCall'