Introduce OptionalToObjectConverter
#34544
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Overview
We have an
ObjectToOptionalConverter
since Spring Framework 4.1; however, we do not have a standardConverter
for the inverse.As discussed in #20433 (comment), it would beneficial to have an
OptionalToObjectConverter
.Although its primary use would likely be in SpEL expressions, we should investigate whether it makes sense to register it by default in
DefaultConversionService
, especially since doing so would allow theOptionalToObjectConverter
to be package-private likeObjectToOptionalConverter
.Related Issues
Optional
with null-safe and Elvis operators in SpEL expressions #20433The text was updated successfully, but these errors were encountered: