Settings

Theme

Optional/Named Arguments for Java

github.com

1 points by owlstuffing 14 days ago · 1 comment

Reader

owlstuffingOP 14 days ago

Explores advanced optional parameters & named arguments as a Java compiler plugin. Complete IDE integration available with IntelliJ.

Key features

- Optional parameters -- Define default values directly in methods, constructors, and records

- Named arguments -- Call methods using parameter names for clarity and flexibility

- Flexible defaults -- Use expressions, reference earlier parameters, and access local methods and fields

- Customizable behavior -- Override default values in subclasses or other contexts

- Safe API evolution -- Add parameters or change defaults without breaking binary or source compatibility

- Eliminates overloads and builders -- Collapse boilerplate into a single, expressive method or constructor

- IDE-friendly -- Fully supported in IntelliJ IDEA and Android Studio

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection