Support Java 8 java.util.Optional type
It's a little bit more than adding a built-in conversion:
- For
Optional<T> propsource property:- add check for
prop.isPresent()in addition to the null-check (in every spot where we currently use our null-check assignment wrapper) - using
prop.get()to fetch the value
- add check for
- For
Optional<T> proptarget property:- use
Optional.empty()instead ofnullfor null-assignments, orOptional.ofNullable(..)for other assignments.
- use
Optionally (pun intended) also support the equivalent in Guavas com.google.common.base.Optional, which uses different names for the factory methods.