mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#3040: Allow using only BeanMapping#mappingControl
This commit is contained in:
parent
81b2f70dac
commit
bb099a55ee
@ -92,6 +92,7 @@ public class BeanMappingOptions extends DelegatingOptions {
|
||||
private static boolean isConsistent(BeanMappingGem gem, ExecutableElement method,
|
||||
FormattingMessager messager) {
|
||||
if ( !gem.resultType().hasValue()
|
||||
&& !gem.mappingControl().hasValue()
|
||||
&& !gem.qualifiedBy().hasValue()
|
||||
&& !gem.qualifiedByName().hasValue()
|
||||
&& !gem.ignoreUnmappedSourceProperties().hasValue()
|
||||
|
@ -7,7 +7,6 @@ package org.mapstruct.ap.test.subclassmapping;
|
||||
|
||||
import org.mapstruct.BeanMapping;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.NullValueMappingStrategy;
|
||||
import org.mapstruct.SubclassMapping;
|
||||
import org.mapstruct.ap.test.subclassmapping.mappables.Bike;
|
||||
import org.mapstruct.ap.test.subclassmapping.mappables.Car;
|
||||
@ -21,6 +20,6 @@ public interface DeepCloneMethodMapper {
|
||||
|
||||
@SubclassMapping( source = Car.class, target = Car.class )
|
||||
@SubclassMapping( source = Bike.class, target = Bike.class )
|
||||
@BeanMapping( mappingControl = DeepClone.class, nullValueMappingStrategy = NullValueMappingStrategy.RETURN_NULL )
|
||||
@BeanMapping( mappingControl = DeepClone.class )
|
||||
Vehicle map(Vehicle vehicle);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user