Skip to content
/ Flow Public

The Very light weight java 8 like stream for Android

Notifications You must be signed in to change notification settings

00ec454/Flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Flow

The Very light weight java 8 like stream for Android.

Usage

Filter

        Flow.of(1, 2, 3, 4, 5, 6, 7, 8, 9)
                .filter(n -> n % 2 == 0)
                .forEach(System.out::println);

Reduce

        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

First Match

        String firstMatch = Flow.of("USA", "Canada", "India", "Russia", "China")
                .firstMatch(c -> c.endsWith("ia"));
        System.out.println(firstMatch); //India

Map

        Flow.of("USA", "Canada", "India", "Russia", "China")
                .map(String::length).forEach(System.out::println);

How to include in your Android project

1. Add this to your project build.gradle

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

2. Add this to your app module's build.gradle file:

dependencies {
    ...
    compile 'com.github.00ec454:Flow:0.5'
}

check the of lib latest version

3. And start using .... :)

About

The Very light weight java 8 like stream for Android

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages