Skip to content

Add ofNullable method to handle nullable inputs#93

Closed
mrkh995 wants to merge 2 commits intobrick:masterfrom
mrkh995:feature/ofNullable
Closed

Add ofNullable method to handle nullable inputs#93
mrkh995 wants to merge 2 commits intobrick:masterfrom
mrkh995:feature/ofNullable

Conversation

@mrkh995
Copy link
Contributor

@mrkh995 mrkh995 commented May 31, 2025

Closes #92

Adds a static ofNullable() factory method, allowing convenient instantiation when the input might be null.

This improves fluency when working with optional numeric values (e.g., from databases or APIs), avoiding repetitive null checks. If the input is null, the method simply returns null; otherwise, it delegates to ::of().

@mrkh995 mrkh995 closed this May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a factory method that returns null for null input

1 participant