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
package delegation | |
import groovy.transform.TupleConstructor | |
@TupleConstructor | |
class BeanOne implements Comparable<BeanOne> { | |
String firstName | |
String familyName | |
public String getFullName() { |
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
package delegation | |
import groovy.transform.TupleConstructor | |
@TupleConstructor | |
class BeanTwo implements Comparable<BeanTwo> { | |
int yob | |
public int getAge() { | |
new Date().year - yob |
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
package delegation | |
import groovy.transform.Sortable | |
class DelegationBean { | |
@Delegate | |
BeanOne person | |
@Delegate | |
BeanTwo dateOfBirth |
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
URLClassLoader cl = (URLClassLoader) App.class.getClassLoader(); | |
URL url = cl.findResource("META-INF/MANIFEST.MF"); | |
Manifest manifest = new Manifest(url.openStream()); | |
Attributes attr = manifest.getMainAttributes()); | |
System.out.println(manifest.getMainAttributes().getValue("Implementation-Title")); |
OlderNewer