@Override @Nonnull public RecordFinder findChildren() { return artist.findRecords(); } }
@Override @Nonnull public TrackFinder findChildren() { return artist.findTracks(); } }
@Override public Id getId() { return musicArtist.getId(); }
artists.forEach(artist -> pw.printf(" %s - %s%n", displayNameOf(artist), artist.getSource().orElse(new Id("unknown")))); pw.printf(" COUNT OF ALL ARTISTS RETRIEVED BY %d QUERIES%n", artistCountQueryCount); pw.printf(" ALL ARTISTS RETRIEVED BY %d QUERIES%n", artistsQueryCount); final TrackFinder artistTracksFinder = artist.findTracks(); pw.printf("%nTRACKS OF %s (%d):%n", displayNameOf(artist), artistTracksFinder.count()); artistTracksFinder.stream().forEach(track -> assertEquals(track.getSource(), artist.getSource()); }); final RecordFinder recordFinder = artist.findRecords(); pw.printf("%nRECORDS OF %s (%d):%n", displayNameOf(artist), recordFinder.count()); recordFinder.stream().forEach(record -> pw.printf(" %s%n", displayNameOf(record))); recordFinder.stream().forEach(record -> assertEquals(record.getSource(), artist.getSource())); pw.printf(" RETRIEVED BY %d QUERIES%n", getLatestQueryCount()); }); final PerformanceFinder performanceFinder = artist.findPerformances(); pw.printf("%nPERFORMANCES OF %s (%d):%n", displayNameOf(artist), performanceFinder.count()); performanceFinder.stream().forEach(performance -> pw.printf(" %s%n", performance.toDumpString())); performanceFinder.stream().forEach(performance -> assertEquals(performance.getSource(), artist.getSource())); pw.printf(" RETRIEVED BY %d QUERIES%n", getLatestQueryCount()); });
@Override public <T> T as(Class<T> type) { return musicArtist.as(type); }
@Override public <T> Collection<T> asMany(Class<T> type) { return musicArtist.asMany(type); } }
@Override public <T> T as(Class<T> type, NotFoundBehaviour<T> notFoundBehaviour) { return musicArtist.as(type, notFoundBehaviour); }
/******************************************************************************************************************* * * Constrains the search to tracks made by the given artist. * * @param artist the artist * @return the {@code Finder}, in fluent fashion * ******************************************************************************************************************/ @Nonnull public default TrackFinder madeBy (final @Nonnull MusicArtist artist) { return madeBy(artist.getId()); }
/******************************************************************************************************************* * * Constrains the search to records made by the given artist. * * @param artist the artist * @return the {@code Finder}, in fluent fashion * ******************************************************************************************************************/ @Nonnull public default RecordFinder madeBy (final @Nonnull MusicArtist artist) { return madeBy(artist.getId()); }
/******************************************************************************************************************* * * Constrains the search to performances of the given performer. * * @param performer the id of the performer * @return the {@code Finder}, in fluent fashion * ******************************************************************************************************************/ @Nonnull public default PerformanceFinder performedBy (final @Nonnull MusicArtist performer) { return performedBy(performer.getId()); } }