Class ProtobufAdditionalSupportedOptionsProvider

java.lang.Object
de.firehead.mapstruct.spi.protobuf.options.ProtobufAdditionalSupportedOptionsProvider
All Implemented Interfaces:
org.mapstruct.ap.spi.AdditionalSupportedOptionsProvider

public class ProtobufAdditionalSupportedOptionsProvider extends Object implements org.mapstruct.ap.spi.AdditionalSupportedOptionsProvider
Options supported by this SPI implementation.
Author:
Rene Schneider
  • Field Details

    • MAP_UNRECOGNIZED_TO_NULL

      public static final String MAP_UNRECOGNIZED_TO_NULL
      Option to configure the automatic mapping of the UNRECOGNIZED enum value generated for Protobuf enums. By default this is TRUE, which means that the UNRECOGNIZED value is automatically mapped to null.

      Typically this value is mapped to null, just like the _UNSPECIFIED value, which works fine if mapping Protobuf enums to Java enums. However there may be reasons to map this value explicitly. For example in case of Protobuf-to-Protobuf mappings, mapping both of these Proto-specific values to null causes the problem of _UNSPECIFIED not being mapped to _UNSPECIFIED of the other enum, but to UNRECOGNIZED. This option allows to disable the automatic mapping of UNRECOGNIZED to null, which fixes the issue in case of Protobuf-to-Protobuf mappings (UNRECOGNIZED then maps to the UNRECOGNIZED value in the other enum), but causes missing mappings in all Protobuf-to-Java cases.

      See Also:
  • Constructor Details

    • ProtobufAdditionalSupportedOptionsProvider

      public ProtobufAdditionalSupportedOptionsProvider()
  • Method Details

    • getAdditionalSupportedOptions

      public Set<String> getAdditionalSupportedOptions()
      Specified by:
      getAdditionalSupportedOptions in interface org.mapstruct.ap.spi.AdditionalSupportedOptionsProvider