title: Map Enum field with MapStruct
body: <p>I want to map 2 models, where each of them has almost the same enums. Let me show:</p>
  
  <p>The first model has enum:</p>
  
  <pre><code>public enum EventSource {
    BETRADAR("SOURCE_BETRADAR"),
    BETGENIUS("SOURCE_BETGENIUS"),
    BETCONSTRUCT("SOURCE_BETCONSTRUCT"),
    MODEL("SOURCE_MODEL");
  </code></pre>
  
  <p>Second model has enum:</p>
  
  <pre><code>public enum SportEventSource implements ProtocolMessageEnum {
    SOURCE_UNKNOWN(0),
    SOURCE_BETRADAR(1),
    SOURCE_BETGENIUS(2),
    SOURCE_BETCONSTRUCT(3),
    UNRECOGNIZED(-1);
  </code></pre>
  
  <p>I have such custom mapping method:</p>
  
  <pre><code>@Named("eventSourceConverter")   
  default EventSource eventSourceConverter(SportEventSource source) {
          switch (source) {
            case SOURCE_MODEL:
              return EventSource.MODEL;
            case SOURCE_BETCONSTRUCT:
              return EventSource.BETCONSTRUCT;
            case SOURCE_BETGENIUS:
              return EventSource.BETGENIUS;
            case SOURCE_BETRADAR:
              return EventSource.BETRADAR;
            default:
              return EventSource.MODEL;
          }   
  }
  </code></pre>
  
  <p>And then I use:</p>
  
  <pre><code>  @Mapping(target = "mainSource", source = "source", qualifiedByName = "eventSourceConverter")
    AdapterCompetitor protoToModel(Competitor proto);
  </code></pre>
  
  <p>But get:</p>
  
  <pre><code>error: The following constants from the property "SportEventSource source" enum have no corresponding constant in the "*source*" enum and must be mapped via adding additional mappings: SOURCE_UNKNOWN, SOURCE_BETRADAR, SOURCE_BETGENIUS, SOURCE_BETCONSTRUCT, UNRECOGNIZED.
    AdapterCompetitor protoToModel(Competitor proto);
  </code></pre>
  
  <p>I've also created the enum mapper like:</p>
  
  <pre><code>  @ValueMappings({
        @ValueMapping(source = "SOURCE_BETRADAR", target = "BETRADAR"),
        @ValueMapping(source = "SOURCE_BETGENIUS", target = "BETGENIUS"),
        @ValueMapping(source = "SOURCE_BETCONSTRUCT", target = "BETCONSTRUCT"),
        @ValueMapping(source = "SOURCE_MODEL", target = "MODEL"),
        @ValueMapping(source = "SOURCE_UNKNOWN", target = "MODEL"),
        @ValueMapping(source = "UNRECOGNIZED", target = "MODEL")
    })
    EventSource eventSourceToSportEventSource(SportEventSource source);
  </code></pre>
  
  <p>But I don't need to have it separately, just want that enum field will be mapped within the internal mapping. Simply to say — when I do <code>AdapterCompetitor protoToModel(Competitor proto)</code> enum also should be mapped.</p>
  
  <p>Thanks!</p>
  
  <p>p.s. sorry for my eng, hope my questions make sense :)</p>