I disagree. The problem with Null in my opinion is that it is the default and can easily be created accidentally.
There's nothing inherently wrong with an "absence of value, value"
Optional.empty is not null, it's no-value
There's nothing inherently wrong with an "absence of value, value"
Optional.empty is not null, it's no-value
In our code base this means we have a the rule that Optional is only allowed for returns so we aren't adding 3rd cases all over the place.
Other compile time typed languages (C, C++, C#, typescript, rust, kotlin) usually would let you enforce that as part of the type system, but the java compiler will silently accept null in place of optional and throw an NPE at runtime.
I have to agree with the Optional hate. I loved it in Scala but after a few months on Kotlin I don't think I can go back.
Any sane json library has to support newer Java idioms, if not it is not worth using.