| I noticed an interesting challenge when it comes to Optional. As per the JDK folks its usage is not recommended as a field type, but rather as the return type of methods. Therefore it seems not an unexpected pattern to declare a field of type Foo gut the return type of the corresponding getter as Optional<Foo>. I'm not sure whether this difference in field and getter type is a problem. At least for the meta-data API there's the problem of getElementClass(), should we return Foo or Optional? On first thought I'd be inclined towards the latter, maybe with a new method isOptional() (if there is need for it). |