
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-codeInstalls 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 Optionalidiomatic usage:map/flatMap/filter/orElse*overisPresent()+get()- Function composition:
andThen/compose - Higher-order functions: memoization, currying, partial application
- Pattern Matching for
instanceofandswitch(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- 131 Java Testing Unit Testing134
- 112 Java Maven Plugins133
- 143 Java Functional Exception Handling133
- 122 Java Type Design132
- 144 Java Data Oriented Programming129
- 170 Java Documentation129
- 132 Java Testing Integration Testing128
- 113 Java Maven Documentation125
- 110 Java Maven Best Practices160
- 121 Java Object Oriented Design153
- 124 Java Secure Coding146
- 111 Java Maven Dependencies136
- 125 Java Concurrency135
- 128 Java Generics135
- 141 Java Refactoring With Modern Features135