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
9794543946
commit
257796b959
@ -103,6 +103,7 @@ public class BeanMappingOptions extends DelegatingOptions {
|
|||||||
private static boolean isConsistent(BeanMappingGem gem, ExecutableElement method,
|
private static boolean isConsistent(BeanMappingGem gem, ExecutableElement method,
|
||||||
FormattingMessager messager) {
|
FormattingMessager messager) {
|
||||||
if ( !gem.resultType().hasValue()
|
if ( !gem.resultType().hasValue()
|
||||||
|
&& !gem.mappingControl().hasValue()
|
||||||
&& !gem.qualifiedBy().hasValue()
|
&& !gem.qualifiedBy().hasValue()
|
||||||
&& !gem.qualifiedByName().hasValue()
|
&& !gem.qualifiedByName().hasValue()
|
||||||
&& !gem.ignoreUnmappedSourceProperties().hasValue()
|
&& !gem.ignoreUnmappedSourceProperties().hasValue()
|
||||||
|
@ -7,7 +7,6 @@ package org.mapstruct.ap.test.subclassmapping;
|
|||||||
|
|
||||||
import org.mapstruct.BeanMapping;
|
import org.mapstruct.BeanMapping;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.NullValueMappingStrategy;
|
|
||||||
import org.mapstruct.SubclassMapping;
|
import org.mapstruct.SubclassMapping;
|
||||||
import org.mapstruct.ap.test.subclassmapping.mappables.Bike;
|
import org.mapstruct.ap.test.subclassmapping.mappables.Bike;
|
||||||
import org.mapstruct.ap.test.subclassmapping.mappables.Car;
|
import org.mapstruct.ap.test.subclassmapping.mappables.Car;
|
||||||
@ -21,6 +20,6 @@ public interface DeepCloneMethodMapper {
|
|||||||
|
|
||||||
@SubclassMapping( source = Car.class, target = Car.class )
|
@SubclassMapping( source = Car.class, target = Car.class )
|
||||||
@SubclassMapping( source = Bike.class, target = Bike.class )
|
@SubclassMapping( source = Bike.class, target = Bike.class )
|
||||||
@BeanMapping( mappingControl = DeepClone.class, nullValueMappingStrategy = NullValueMappingStrategy.RETURN_NULL )
|
@BeanMapping( mappingControl = DeepClone.class )
|
||||||
Vehicle map(Vehicle vehicle);
|
Vehicle map(Vehicle vehicle);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user