Java8 utilities powered by Lombok
public class EmployeeFinderService {
public List<Employee> findAllEmployees() {
final List<Company> companies = ...
return companies.stream()
.map(Company::getEmployees)
.flatMap(Collection::stream)
.collect(Collectors.toList());
}
...
}
@ExtensionMethod(ListOps.class)
public class EmployeeFinderService {
public List<Employee> findAllEmployees() {
final List<Company> companies = ...
return companies.flatMap(Company::getEmployees);
}
...
}
- Setup Lombok. see http://projectlombok.org/mavenrepo/index.html
- Add Sonatype snapshot repository and add dependencies.
repositories {
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
compile 'jp.t2v:xanadu:0.1.0-SNAPSHOT'
}
This library is released under the Apache Software License, version 2, which should be included with the source in a file named LICENSE.