Skip to content

Add ofNullable method to handle nullable inputs #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mrkh995
Copy link

@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().

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