src/main/java/org/intellimate/izou/sdk/frameworks/music/events/StartMusicRequest.java
public static Optional<StartMusicRequest> createStartMusicRequest(Identification source, Identification target, Playlist playlist, boolean isUsingJava) {
        if (target.equals(source))
            return Optional.empty();
        try {
            StartMusicRequest request = new StartMusicRequest(source, isUsingJava);
            request.addResource(new SelectorResource(source, target));
            if (playlist != null)
                request.addResource(new PlaylistResource(target, playlist, source));
            return Optional.of(request);
        } catch (IllegalArgumentException e) {
            return Optional.empty();
        }
    }
public static Optional<StartMusicRequest> createStartMusicRequest(Identification source, Identification target, Playlist playlist, boolean isUsingJava) {
        if (target.equals(source))
            return Optional.empty();
        try {
            StartMusicRequest request = new StartMusicRequest(source, isUsingJava);
            request.addResource(new SelectorResource(source, target));
            if (playlist != null)
                request.addResource(new PlaylistResource(target, playlist, source));
            return Optional.of(request);
        } catch (IllegalArgumentException e) {
            return Optional.empty();
        }
    }
public static Optional < StartMusicRequest > createStartMusicRequest ( Identification source , Identification target , Playlist playlist , boolean isUsingJava ) { if ( target . equals ( source ) ) return Optional . empty ( ) ; try { StartMusicRequest request = new StartMusicRequest ( source , isUsingJava ) ; request . addResource ( new SelectorResource ( source , target ) ) ; if ( playlist != null ) request . addResource ( new PlaylistResource ( target , playlist , source ) ) ; return Optional . of ( request ) ; } catch ( IllegalArgumentException e ) { return Optional . empty ( ) ; } }
creates a new StartRequest
@param source the caller
@param target the target who should start playing
@param playlist the playlist to play
@param isUsingJava true if the player is using java
@return the optional StartMusicRequest
creates a new StartRequest