Class FunctionalResultHandler

  • All Implemented Interfaces:
    AudioLoadResultHandler

    public class FunctionalResultHandler
    extends java.lang.Object
    implements AudioLoadResultHandler
    Helper class for creating an audio result handler using only methods that can be passed as lambdas.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void loadFailed​(FriendlyException exception)
      Called when loading an item failed with an exception.
      void noMatches()
      Called when there were no items found by the specified identifier.
      void playlistLoaded​(AudioPlaylist playlist)
      Called when the requested item is a playlist and it was successfully loaded.
      void trackLoaded​(AudioTrack track)
      Called when the requested item is a track and it was successfully loaded.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FunctionalResultHandler

        public FunctionalResultHandler​(java.util.function.Consumer<AudioTrack> trackConsumer,
                                       java.util.function.Consumer<AudioPlaylist> playlistConsumer,
                                       java.lang.Runnable emptyResultHandler,
                                       java.util.function.Consumer<FriendlyException> exceptionConsumer)
        Refer to AudioLoadResultHandler methods for details on when each method is called.
        Parameters:
        trackConsumer - Consumer for single track result
        playlistConsumer - Consumer for playlist result
        emptyResultHandler - Empty result handler
        exceptionConsumer - Consumer for an exception when loading the item fails