Vavr extends Java 8+ with immutable collections, functional control structures, pattern matching, and error-handling types. It ships as a standalone JAR with no extra runtime dependencies.
Overview
Vavr (formerly Javaslang) is a non-commercial object-functional library for Java that aims to reduce boilerplate while encouraging defensive programming. It combines familiar object-oriented patterns with functional idioms such as persistent data structures and composable control flow.
The library provides persistent collections, functional abstractions for errors and concurrency, pattern matching, and related utilities documented in the user guide and Javadoc. Because it depends only on the JVM, teams can add the artifact to an existing classpath without pulling in a larger platform.
Maven and Gradle coordinates are published for current releases. Consumers integrate it like any other Java dependency and use its types alongside standard Java platform classes.
Community maintenance includes contribution guidelines covering build and test workflows for developers changing the library itself.
Key features
- Persistent immutable collections
- Functional error-handling abstractions
- Pattern matching support
- Concurrent programming helpers
- Standalone JVM JAR dependency
- Maven and Gradle published artifacts
- User guide and Javadoc documentation
Use cases
- Functional style in legacy Java codebases
- Immutable data structures in Java services
- Safer error handling without deep nesting
- Reducing collection boilerplate in Java