Skip to content

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

@BenMorel
Copy link
Member

Hi, I agree that this would be a good QoL improvement!

Can you please handle the requested changes, rebase, and apply ECS to fix coding standard violations?

@BenMorel BenMorel merged commit d31a996 into brick:master Nov 24, 2025
17 checks passed
@BenMorel
Copy link
Member

I applied ECS and fixed a test that was using of() instead of ofNullable().

Thank you, @mrkh995!

@BenMorel
Copy link
Member

Released as 0.14.1.

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

2 participants