singhbaljit commented on PR #1860:
URL: https://github.com/apache/commons-lang/pull/1860#issuecomment-6780136820

   Lang isn’t primarily a functional programming library, so it's tricky to 
showcase internal usage directly within the codebase itself. In practice, I 
often use these utilities in conjunction with other libraries, like Protobuf, 
Project Reactor, and Kafka Streams.
   
   Here are a few practical use cases I run into frequently:
   
   - `acceptNonNull`: Cleaner than 
`Optional.ofNullable(object).ifPresent(consumer)` because it avoids unnecessary 
object allocation. It's also preferable to manual `if (object != null)` checks 
because it keeps calling code DRY and cuts down on boilerplate null-branch 
testing across pipelines.
   - Constant suppliers/functions: Serves a similar purpose; it's less verbose 
than writing out throwaway lambdas and makes pipeline setups and test 
assertions much cleaner.
   
   That said, if you'd prefer to see internal usage first, I’m happy to look 
through Lang's codebase and open a commit refactoring existing code to use 
these methods.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to