Search in sources :

Example 21 with ChartEntry

use of org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntry in project mapstruct by mapstruct.

the class ArtistToChartEntryImpl method map.

@Override
public ChartEntry map(Chart name) {
    if (name == null) {
        return null;
    }
    ChartEntry chartEntry = new ChartEntry();
    chartEntry.setChartName(name.getName());
    return chartEntry;
}
Also used : ChartEntry(org.mapstruct.ap.test.nestedsourceproperties._target.ChartEntry)

Example 22 with ChartEntry

use of org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntry in project mapstruct by mapstruct.

the class ArtistToChartEntryImpl method map.

@Override
public ChartEntry map(Chart chart, Song song, Integer position) {
    if (chart == null && song == null && position == null) {
        return null;
    }
    ChartEntry chartEntry = new ChartEntry();
    if (chart != null) {
        chartEntry.setChartName(chart.getName());
    }
    if (song != null) {
        chartEntry.setSongTitle(song.getTitle());
        chartEntry.setArtistName(songArtistName(song));
        chartEntry.setRecordedAt(songArtistLabelStudioName(song));
        chartEntry.setCity(songArtistLabelStudioCity(song));
    }
    if (position != null) {
        chartEntry.setPosition(position);
    }
    return chartEntry;
}
Also used : ChartEntry(org.mapstruct.ap.test.nestedsourceproperties._target.ChartEntry)

Example 23 with ChartEntry

use of org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntry in project mapstruct by mapstruct.

the class ArtistToChartEntryImpl method map.

@Override
public ChartEntry map(Song song) {
    if (song == null) {
        return null;
    }
    ChartEntry chartEntry = new ChartEntry();
    chartEntry.setSongTitle(song.getTitle());
    chartEntry.setArtistName(songArtistName(song));
    chartEntry.setRecordedAt(songArtistLabelStudioName(song));
    chartEntry.setCity(songArtistLabelStudioCity(song));
    return chartEntry;
}
Also used : ChartEntry(org.mapstruct.ap.test.nestedsourceproperties._target.ChartEntry)

Example 24 with ChartEntry

use of org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntry in project mapstruct by mapstruct.

the class ChartEntryToArtistImpl method map.

@Override
public ChartEntry map(Chart chart) {
    if (chart == null) {
        return null;
    }
    ChartEntry chartEntry = new ChartEntry();
    chartEntry.setChartName(chart.getName());
    chartEntry.setSongTitle(chartSongTitle(chart));
    chartEntry.setArtistName(chartSongArtistName(chart));
    chartEntry.setRecordedAt(chartSongArtistLabelStudioName(chart));
    chartEntry.setCity(chartSongArtistLabelStudioCity(chart));
    chartEntry.setPosition(mapPosition(chartSongPositions(chart)));
    return chartEntry;
}
Also used : ChartEntry(org.mapstruct.ap.test.nestedsourceproperties._target.ChartEntry)

Example 25 with ChartEntry

use of org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntry in project mapstruct by mapstruct.

the class ChartEntryToArtistImpl method map.

@Override
public ChartEntry map(Chart chart) {
    if (chart == null) {
        return null;
    }
    String chartName = null;
    String songTitle = null;
    String artistName = null;
    String recordedAt = null;
    String city = null;
    int position = 0;
    chartName = chart.getName();
    songTitle = chartSongTitle(chart);
    artistName = chartSongArtistName(chart);
    recordedAt = chartSongArtistLabelStudioName(chart);
    city = chartSongArtistLabelStudioCity(chart);
    position = mapPosition(chartSongPositions(chart));
    ChartEntry chartEntry = new ChartEntry(chartName, songTitle, artistName, recordedAt, city, position);
    return chartEntry;
}
Also used : ChartEntry(org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntry)

Aggregations

ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)22 ChartEntry (org.mapstruct.ap.test.nestedsourceproperties._target.ChartEntry)19 WithClasses (org.mapstruct.ap.testutil.WithClasses)16 ChartEntry (org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntry)12 Chart (org.mapstruct.ap.test.nestedsourceproperties.source.Chart)10 Song (org.mapstruct.ap.test.constructor.nestedsource.source.Song)8 Song (org.mapstruct.ap.test.nestedsourceproperties.source.Song)8 Test (org.junit.Test)4 Chart (org.mapstruct.ap.test.constructor.nestedsource.source.Chart)4 BaseChartEntry (org.mapstruct.ap.test.nestedsourceproperties._target.BaseChartEntry)4 BaseChartEntry (org.mapstruct.ap.test.constructor.nestedsource._target.BaseChartEntry)3 Artist (org.mapstruct.ap.test.constructor.nestedsource.source.Artist)2 Label (org.mapstruct.ap.test.constructor.nestedsource.source.Label)2 Studio (org.mapstruct.ap.test.constructor.nestedsource.source.Studio)2 Artist (org.mapstruct.ap.test.nestedsourceproperties.source.Artist)2 Label (org.mapstruct.ap.test.nestedsourceproperties.source.Label)2 Studio (org.mapstruct.ap.test.nestedsourceproperties.source.Studio)2 ChartEntryComposed (org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntryComposed)1 ChartEntryWithBase (org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntryWithBase)1 ChartEntryWithMapping (org.mapstruct.ap.test.constructor.nestedsource._target.ChartEntryWithMapping)1