Last active
August 29, 2015 14:04
-
-
Save jonatasemidio/6e936c1f5cdd18b1c377 to your computer and use it in GitHub Desktop.
Bind properties in Services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.codehaus.groovy.runtime.InvokerHelper | |
class A { String nome; Integer idade } | |
class B { String nome; Integer idade } | |
class C { String nome; Integer idade } | |
A a = new A() | |
B b = new B(nome:'jose', idade: 10) | |
C c = new C(nome:'bira', idade: 99) | |
use(InvokerHelper) { a.setProperties(b.properties) } | |
println a.properties | |
InvokerHelper.setProperties(a, c.properties) | |
println a.properties |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment