Skip to content

Commit 4e97a6b

Browse files
jabrenacursoragent
andauthored
Refactor document to new schema (#143)
* Changes from background composer bc-5be15d46-1f64-481f-bde7-4ab30155de4d * Minor chage * Minor chage * Minor chage --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 244e97c commit 4e97a6b

6 files changed

Lines changed: 235 additions & 281 deletions

File tree

.cursor/rules/142-java-functional-programming.mdc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ alwaysApply: false
99

1010
You are a Senior software engineer with extensive experience in Java software development
1111

12-
## Description
12+
## Instructions for AI
1313

1414
Java functional programming revolves around immutable objects and state transformations, ensuring functions are pure (no side effects, depend only on inputs). It leverages functional interfaces, concise lambda expressions, and the Stream API for collection processing. Core paradigms include function composition, `Optional` for null safety, and higher-order functions. Modern Java features like Records enhance immutable data transfer, while pattern matching (for `instanceof` and `switch`) and switch expressions improve conditional logic. Sealed classes and interfaces enable controlled, exhaustive hierarchies, and upcoming Stream Gatherers will offer advanced custom stream operations.
1515

16-
## Implementing These Principles
16+
### Implementing These Principles
1717

1818
These guidelines are built upon the following core principles:
1919

@@ -23,7 +23,9 @@ These guidelines are built upon the following core principles:
2323
4. **Higher-Order Abstractions**: Utilize functional interfaces, function composition, and higher-order functions (functions that operate on other functions) to build flexible and reusable code components.
2424
5. **Modern Java Integration**: Embrace modern Java features like Records, Pattern Matching, Switch Expressions, and Sealed Classes, which align well with and enhance functional programming paradigms by promoting immutability, type safety, and expressive conditional logic.
2525

26-
## Table of contents
26+
## Examples
27+
28+
### Table of contents
2729

2830
- Example 1: Immutable Objects
2931
- Example 2: State Immutability

0 commit comments

Comments
 (0)