use of org.mapstruct.ap.test.nestedsourceproperties.source.Artist in project mapstruct by mapstruct.
the class ChartEntryToArtistImpl method chartEntryToSong1.
protected void chartEntryToSong1(ChartEntry chartEntry, Song mappingTarget) {
if (chartEntry == null) {
return;
}
if (mappingTarget.getArtist() == null) {
mappingTarget.setArtist(new Artist());
}
chartEntryToArtist1(chartEntry, mappingTarget.getArtist());
mappingTarget.setTitle(chartEntry.getSongTitle());
}
use of org.mapstruct.ap.test.nestedsourceproperties.source.Artist in project mapstruct by mapstruct.
the class ChartEntryToArtistImpl method chartEntryToArtist.
protected Artist chartEntryToArtist(ChartEntry chartEntry) {
if (chartEntry == null) {
return null;
}
Artist artist = new Artist();
artist.setLabel(chartEntryToLabel(chartEntry));
artist.setName(chartEntry.getArtistName());
return artist;
}
use of org.mapstruct.ap.test.nestedsourceproperties.source.Artist in project mapstruct by mapstruct.
the class ChartEntryToArtistImpl method chartSongArtistLabelStudioCity.
private String chartSongArtistLabelStudioCity(Chart chart) {
if (chart == null) {
return null;
}
Song song = chart.getSong();
if (song == null) {
return null;
}
Artist artist = song.getArtist();
if (artist == null) {
return null;
}
Label label = artist.getLabel();
if (label == null) {
return null;
}
Studio studio = label.getStudio();
if (studio == null) {
return null;
}
String city = studio.getCity();
if (city == null) {
return null;
}
return city;
}
use of org.mapstruct.ap.test.nestedsourceproperties.source.Artist in project mapstruct by mapstruct.
the class ChartEntryToArtistImpl method chartSongArtistLabelStudioName.
private String chartSongArtistLabelStudioName(Chart chart) {
if (chart == null) {
return null;
}
Song song = chart.getSong();
if (song == null) {
return null;
}
Artist artist = song.getArtist();
if (artist == null) {
return null;
}
Label label = artist.getLabel();
if (label == null) {
return null;
}
Studio studio = label.getStudio();
if (studio == null) {
return null;
}
String name = studio.getName();
if (name == null) {
return null;
}
return name;
}
use of org.mapstruct.ap.test.nestedsourceproperties.source.Artist in project mapstruct by mapstruct.
the class ReversingNestedSourcePropertiesTest method prepareSong.
private Song prepareSong() {
Studio studio = new Studio();
studio.setName("Abbey Road");
studio.setCity("London");
Label label = new Label();
label.setStudio(studio);
label.setName("EMY");
Artist artist = new Artist();
artist.setName("The Beatles");
artist.setLabel(label);
Song song = new Song();
song.setArtist(artist);
song.setTitle("A Hard Day's Night");
return song;
}
Aggregations