@Override @Nonnull public Optional<Performance> getPerformance() { return performance.get(() -> _findPerformances().ofTrack(this).optionalFirstResult()); }
@Override @Nonnull public PerformanceFinder findPerformances() { return _findPerformances().performedBy(this); }
/******************************************************************************************************************* * * Constrains the search to performances of the given track. * * @param track the track * @return the {@code Finder}, in fluent fashion * ******************************************************************************************************************/ @Nonnull public default PerformanceFinder ofTrack (final @Nonnull Track track) { return ofTrack(track.getId()); }
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()); });
/******************************************************************************************************************* * * 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()); } }