Created
June 1, 2016 10:45
-
-
Save vkoloss/f346eba74eea0d515f7184cf583b33fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 groovy.transform.EqualsAndHashCode | |
| @EqualsAndHashCode(includeFields=true) | |
| public class Person { | |
| String name; | |
| String lastName; | |
| @Delegate | |
| List<String> expertises = []; | |
| def getFullName() { | |
| "$name $lastName" | |
| } | |
| def getCommaSeparated() { | |
| expertises.join(', ') | |
| } | |
| } | |
| p.metaClass.removeJTech = { -> | |
| delegate.expertises.removeAll { | |
| it.charAt(0) == 'j' | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment