public static Optional<StartMusicRequest> createStartMusicRequest(Identification source, Identification target, TrackInfo trackInfo, boolean isUsingJava) {
        if (target.equals(source))
            return Optional.empty();
        try {
            StartMusicRequest request = new StartMusicRequest(source, isUsingJava);
            request.addResource(new SelectorResource(source, target));
            if (trackInfo != null)
                request.addResource(new TrackInfoResource(target, trackInfo, source));
            return Optional.of(request);
        } catch (IllegalArgumentException e) {
            return Optional.empty();
        }
    }
public static Optional<StartMusicRequest> createStartMusicRequest(Identification source, Identification target, TrackInfo trackInfo, boolean isUsingJava) {
        if (target.equals(source))
            return Optional.empty();
        try {
            StartMusicRequest request = new StartMusicRequest(source, isUsingJava);
            request.addResource(new SelectorResource(source, target));
            if (trackInfo != null)
                request.addResource(new TrackInfoResource(target, trackInfo, source));
            return Optional.of(request);
        } catch (IllegalArgumentException e) {
            return Optional.empty();
        }
    }
public static Optional < StartMusicRequest > createStartMusicRequest ( Identification source , Identification target , TrackInfo trackInfo , boolean isUsingJava ) { if ( target . equals ( source ) ) return Optional . empty ( ) ; try { StartMusicRequest request = new StartMusicRequest ( source , isUsingJava ) ; request . addResource ( new SelectorResource ( source , target ) ) ; if ( trackInfo != null ) request . addResource ( new TrackInfoResource ( target , trackInfo , 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 trackInfo the track to play
@param isUsingJava true if the player is using java
@return the optional StartMusicRequest
creates a new StartRequest