Skip to content

Add support for Builders with multiple build methods #1479

@filiphr

Description

@filiphr

Protobuf has mutliple public parameterless methods that create the type in the builder:

  • getDefaultInstanceForType
  • build
  • buildPartial

Currently we pick getDefaultInstanceForType without any error. This is clearly a mistake and we should either:

  • not pick any and error out so the user can define a custom SPI that would pick the correct
  • provide a custom SPI for Protobuf that would pick the build method.

An example code can be found here. The CompetitionMapper can be adjusted to map into PBCompetition instead of PBCompetition.Builder

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions