jabrena avatar

142 Java Functional Programming

This is a comprehensive refactoring assistant that applies modern Java functional programming patterns to your codebase. It covers the essentials like immutable Records, Streams, and Optional, plus newer features like pattern matching, sealed classes, and Stream Gatherers from Java 21. What makes it solid is the safety-first approach: it won't touch your code unless the project compiles first, and it verifies everything afterward with a full Maven build. The reference material includes good and bad examples for each pattern, so you get concrete guidance on moving side effects to boundaries and keeping your core logic pure. If you're modernizing a Java codebase or just tired of null checks and mutable state, this walks you through the transformation methodically.

skills.sh installs
135
GitHub stars
393
last updated
Jun 3, 2026

Install

$ npx -y skills add jabrena/cursor-rules-java --skill 142-java-functional-programming --agent claude-code

Installs into .claude/skills of the current project.

Files

Java Functional Programming rules

Identify and apply functional programming principles in Java to improve immutability, expressiveness, and maintainability.

What is covered in this Skill?

  • Immutable objects and Records (JEP 395)
  • Pure functions free of side effects
  • Functional interfaces: Function, Predicate, Consumer, Supplier, custom @FunctionalInterface
  • Lambda expressions and method references
  • Stream API: filter/map/reduce pipelines, parallel streams, toUnmodifiable* collectors
  • Optional idiomatic usage: map/flatMap/filter/orElse* over isPresent()+get()
  • Function composition: andThen/compose
  • Higher-order functions: memoization, currying, partial application
  • Pattern Matching for instanceof and switch (Java 21)
  • Sealed classes and interfaces (Java 17) for exhaustive domain hierarchies
  • Switch Expressions (Java 14), Stream Gatherers (JEP 461)
  • Effect-boundary separation: side effects at edges, pure core logic
  • Immutable collections: List.of(), Collectors.toUnmodifiableList()

Sponsors

Details

Repository
github.com/jabrena/cursor-rules-java
Category
Java & JVM
First seen
Jun 3, 2026

More from jabrena/cursor-rules-java

All 16

Recommended

More Java & JVM
1absolutelyskilled avatarandroid-kotlinabsolutelyskilled/absolutelyskilledandroid kotlin133skills.sh installs
2jabrena avatar144-java-data-oriented-programmingjabrena/cursor-rules-java144 java data oriented programming129skills.sh installs
3jabrena avatar170-java-documentationjabrena/cursor-rules-java170 java documentation129skills.sh installs
4aiskillstore avataralibaba-java-coding-guidelines-skillaiskillstore/marketplaceThis brings Alibaba's Java coding guidelines into your editor as a reviewable standard.0skills.sh installs
5limrun-inc avatarlimrun-gradlelimrun-inc/skillsBuild an Android app on a remote Gradle sandbox with `lim gradle build` instead of local Gradle or Android Studio, from any environment (Linux, Windows, macOS, 41.5Kskills.sh installs
6github avatarjava-docsgithub/awesome-copilotEnsure that Java types are documented with Javadoc comments and follow best practices for documentation.10.8Kskills.sh installs