Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/** | |
* Dynamically discover and add modules in our project | |
* */ | |
val moduleBuildFileName = "build.gradle.kts" | |
// A pattern to match the prefix of our modules | |
val eligibleModuleNamePattern = "a_pattern_to_match_our_module_names".toRegex() // (e.g.: (app|android-|kotlin-).*) | |
// Filter directories that indicate modules | |
val moduleFilter: FileFilter = FileFilter { pathname: File -> |
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
/** | |
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). | |
* https://openapi-generator.tech | |
* Do not edit the class manually. | |
*/ | |
package {{package}}; | |
{{#imports}}import {{import}}; | |
{{/imports}} | |
import io.swagger.annotations.*; |
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
final Map<Employee.Sex, List<Employee>> employeesOverThirtyBySex = employees.stream() | |
.collect(groupingBy(Employee::getSex, filtering(employee -> employee.getAge() > 30, toList()))); |
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
final Map<Employee.Sex, Optional<Employee>> youngestEmployeeBySex = employees.stream() | |
.collect(groupingBy(Employee::getSex, minBy(comparing(Employee::getAge)))); |
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
final Map<Employee.Sex, Map<Integer, List<Employee>>> groupBySexAndAge = employees.stream() | |
.collect(groupingBy(Employee::getSex, groupingBy(Employee::getAge))); |
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
final Map<Employee.Sex, Double> averageAgeBySex = employees.stream() | |
.collect(groupingBy(Employee::getSex, averagingInt(Employee::getAge))); |
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
final Map<Employee.Sex, Set<Employee>> employeesBySex = employees.stream() | |
.collect(groupingBy(Employee::getSex, toSet())); |
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
final Collection<Employee> employees = List.of( | |
new Employee("Karen Smith", 51200.0, 29, Employee.Sex.FEMALE), | |
new Employee("John Smith", 24000.0, 32, Employee.Sex.MALE), | |
new Employee("Anthony Jackson", 44000.0, 33, Employee.Sex.MALE), | |
new Employee("Alyson Palmer", 34320.0, 36, Employee.Sex.FEMALE), | |
new Employee("Jessica Sanders", 64320.0, 34, Employee.Sex.FEMALE) | |
); | |
final Map<Employee.Sex, List<Employee>> employeesBySex = employees.stream() | |
.collect(groupingBy(Employee::getSex)); |