Skip to content

NibioOpenSource/underscore-java11

 
 

Repository files navigation

underscore-java11

Maven Central MIT License Build Status codecov Quality Gate Quality Gate Build Status Java Version

Requirements

Java 11 and later.

Installation

Include the following in your pom.xml for Maven:

<dependencies>
  <dependency>
    <groupId>com.github.javadev</groupId>
    <artifactId>underscore11</artifactId>
    <version>1.6</version>
  </dependency>
  ...
</dependencies>

Gradle:

compile 'com.github.javadev:underscore11:1.6'

Underscore-java is a java port of Underscore.js.

Usage

U.chain(/* array | list | set | map | anything based on Iterable interface */)
    .filter(..)
    .map(..)
    ...
    .sortWith()
    .forEach(..);
U.chain(value1, value2, value3)...
U.range(0, 10)...

U.chain(1, 2, 3) // or java.util.Arrays.asList(1, 2, 3) or new Integer[] {1, 2, 3}
    .filter(v -> v > 1)
    // 2, 3
    .map(v -> v + 1)
    // 3, 4
    .sortWith((a, b) -> b.compareTo(a))
    // 4, 3
    .forEach(System.out::println);
    // 4, 3

In addition to porting Underscore's functionality, Underscore-java includes matching unit tests.

For docs, license, tests, and downloads, see: http://javadev.github.io/underscore-java

Thanks to Jeremy Ashkenas and all contributors to Underscore.js.

About

java 11 port of Underscore.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 87.1%
  • JavaScript 12.9%