salvin francis wrote:I have effectively stopped writing null checks.
Stephan van Hulst wrote:Optional is not meant for method parameters.
Stephan van Hulst wrote:It makes your API really unwieldy to use. Passing null into methods should be the exception rather than the norm, and you're forcing the client of your method to keep wrapping their arguments in a call to Optional.of(), just for the sake of making your method implementation more fun to write.
Developer, Researcher & Author
@pragprog Author of http://java.by-comparison.com
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |