Skip to content

Make ConvertWith applicable to a larger scope #4514

@asarkar

Description

@asarkar

Currently ConvertWith only applies to a single parameter, so, a method using the same converter more than once becomes extremely verbose.

void testMostVisitedPattern(
  @ConvertWith(IterableConverter.class) String[] username,
  @ConvertWith(IterableConverter.class) int[] timestamp,
  @ConvertWith(IterableConverter.class) String[] website,
  @ConvertWith(IterableConverter.class) List<String> expected) {...}

Deliverables

  • Make ConvertWith applicable to a method such that if no other converter is found or specified for a parameter, the method-level converter will be used.
  • Alternatively, provide a way to register converters globally, akin to what the Spring Framework does.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions