configure
Configures an object via a closure, with the closure's delegate set to the supplied object. This way you don't have to specify the context of a configuration statement multiple times.
Instead of:
MyType myType = new MyType()
myType.doThis()
myType.doThat()
you can do:
MyType myType = configure(new MyType()) {
doThis()
doThat()
}
The object being configured is also passed to the closure as a parameter, so you can access it explicitly if required:
configure(someObj) { obj -> obj.doThis() }
Return
The configured object
Since
0.7
Parameters
The object to configure
The closure with configure statements
Configures a collection of objects via a closure. This is equivalent to calling configure for each of the given objects.
Return
The configured objects.
Since
0.7
Parameters
The objects to configure
The closure with configure statements
Configures a collection of objects via an action.
Return
The configured objects.
Since
0.9
Parameters
The objects to configure
The action to apply to each object