Skip to content

Support Java 8 java.util.Optional type #674

@agudian

Description

@agudian

It's a little bit more than adding a built-in conversion:

  • For Optional<T> prop source 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
  • For Optional<T> prop target property:
    • use Optional.empty() instead of null for null-assignments, or Optional.ofNullable(..) for other assignments.

Optionally (pun intended) also support the equivalent in Guavas com.google.common.base.Optional, which uses different names for the factory methods.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions