forked from mapstruct/mapstruct
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mapstruct#2596 Record components should have the highest priority for…
… read accessors
- Loading branch information
Showing
5 changed files
with
111 additions
and
7 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...t/src/test/resources/recordsTest/src/main/java/org/mapstruct/itest/records/MemberDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright MapStruct Authors. | ||
* | ||
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package org.mapstruct.itest.records; | ||
|
||
/** | ||
* @author Filip Hrisafov | ||
*/ | ||
public record MemberDto(Boolean isActive, Boolean premium) { | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...rc/test/resources/recordsTest/src/main/java/org/mapstruct/itest/records/MemberEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright MapStruct Authors. | ||
* | ||
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package org.mapstruct.itest.records; | ||
|
||
/** | ||
* @author Filip Hrisafov | ||
*/ | ||
public class MemberEntity { | ||
|
||
private Boolean isActive; | ||
private Boolean premium; | ||
|
||
public Boolean getIsActive() { | ||
return isActive; | ||
} | ||
|
||
public void setIsActive(Boolean active) { | ||
isActive = active; | ||
} | ||
|
||
public Boolean getPremium() { | ||
return premium; | ||
} | ||
|
||
public void setPremium(Boolean premium) { | ||
this.premium = premium; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...rc/test/resources/recordsTest/src/main/java/org/mapstruct/itest/records/MemberMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright MapStruct Authors. | ||
* | ||
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package org.mapstruct.itest.records; | ||
|
||
import org.mapstruct.Mapper; | ||
import org.mapstruct.ReportingPolicy; | ||
import org.mapstruct.factory.Mappers; | ||
|
||
/** | ||
* @author Filip Hrisafov | ||
*/ | ||
@Mapper(unmappedSourcePolicy = ReportingPolicy.ERROR) | ||
public interface MemberMapper { | ||
|
||
MemberMapper INSTANCE = Mappers.getMapper( MemberMapper.class ); | ||
|
||
MemberEntity fromRecord(MemberDto record); | ||
|
||
MemberDto toRecord(MemberEntity entity); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters