@Retention(value=CLASS) @Target(value={METHOD,ANNOTATION_TYPE}) public @interface Mappings
TIP: When using Java 8 or later, you can omit the @Mappings wrapper annotation and directly specify several @Mapping annotations on one method.
These two examples are equal.
// before Java 8
@Mapper
public interface MyMapper {
@Mappings({
@Mapping(source = "first", target = "firstProperty"),
@Mapping(source = "second", target = "secondProperty")
})
HumanDto toHumanDto(Human human);
}
// Java 8 and later
@Mapper
public interface MyMapper {
@Mapping(source = "first", target = "firstProperty"),
@Mapping(source = "second", target = "secondProperty")
HumanDto toHumanDto(Human human);
}
public abstract Mapping[] value
Copyright © 2012-2021 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.