This stream API can use under API level 24
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.kss2:LLStream:1.0.2'
}
String[] result = LLStream.filter(str, s -> s.equals("a"));
Person[] result2 = LLStream.filter(people, elem -> elem.age == 10);
int[] result3 = LLStream.filter(nums, elem -> elem == 1);
ArrayList<Integer> result4 = LLStream.filter(list, elem -> elem == 1);
TreeMap<String, Integer> result5 = LLStream.filter(map, elem -> elem.getKey().equals("banana"));
TreeSet<Integer> result6 = LLStream.filter(set, elem -> elem == 3);
filter
reduce
any
all
count
skip
skipLast
take
takeLast
skipTake
skipTakeLast
indexOf (predicate)
get (findByIndex or findByPredicate)
getOrDefault (findByIndex or findByPredicate)
single(predicate)
singleOrDefault(predicate)
LLStream is under MIT license. See the LICENSE file for more info.