The Very light weight java 8 like stream for Android.
Flow.of(1, 2, 3, 4, 5, 6, 7, 8, 9)
.filter(n -> n % 2 == 0)
.forEach(System.out::println);
Integer sum = Flow.of(1, 2, 3, 4, 5, 6, 7, 8, 9)
.reduce(0, (n1, n2) -> n1 + n2);
System.out.println(sum); //output: 45
String firstMatch = Flow.of("USA", "Canada", "India", "Russia", "China")
.firstMatch(c -> c.endsWith("ia"));
System.out.println(firstMatch); //India
Flow.of("USA", "Canada", "India", "Russia", "China")
.map(String::length).forEach(System.out::println);
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
...
compile 'com.github.00ec454:Flow:0.5'
}
check the of lib latest version