Skip to content

Add convert(Object, TypeDescriptor) method to ConversionService #25394

@raderio

Description

@raderio

At the moment there is the method

Object convert(@Nullable Object source, @Nullable TypeDescriptor sourceType, TypeDescriptor targetType);

And usually sourceType can be deduced from source and it is unnecessary to specify the sourceType. Please add a new convert method which will remove necessity to specify the type descriptor if it is the same as source.

Object convert(@Nullable Object source, TypeDescriptor targetType) {
    return convert(source, TypeDescriptor.forObject(source), targetType);
}

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions