src/main/java/org/intellimate/izou/sdk/frameworks/music/events/StartMusicRequest.java
public static boolean verify(EventModel eventModel, Capabilities capabilities, Identifiable player, List<Identifiable> activators) {
        if (!eventModel.containsDescriptor(StartMusicRequest.ID))
            return false;
        if (!capabilities.handlesPlayRequestFromOutside()) {
            if (activators.stream()
                    .noneMatch(identifiable -> identifiable.isOwner(eventModel.getSource())))
                return false;
        }
        if (!PlaylistResource.getPlaylist(eventModel).map(playlist -> playlist.verify(capabilities)).orElse(true)) {
            return false;
        }
        return SelectorResource.isTarget(eventModel, player)
                .orElse(false);
    }
public static boolean verify(EventModel eventModel, Capabilities capabilities, Identifiable player, List<Identifiable> activators) {
        if (!eventModel.containsDescriptor(StartMusicRequest.ID))
            return false;
        if (!capabilities.handlesPlayRequestFromOutside()) {
            if (activators.stream()
                    .noneMatch(identifiable -> identifiable.isOwner(eventModel.getSource())))
                return false;
        }
        if (!PlaylistResource.getPlaylist(eventModel).map(playlist -> playlist.verify(capabilities)).orElse(true)) {
            return false;
        }
        return SelectorResource.isTarget(eventModel, player)
                .orElse(false);
    }
public static boolean verify ( EventModel eventModel , Capabilities capabilities , Identifiable player , List < Identifiable > activators ) { if ( ! eventModel . containsDescriptor ( StartMusicRequest . ID ) ) return false ; if ( ! capabilities . handlesPlayRequestFromOutside ( ) ) { if ( activators . stream ( ) . noneMatch ( identifiable -> identifiable . isOwner ( eventModel . getSource ( ) ) ) ) return false ; } if ( ! PlaylistResource . getPlaylist ( eventModel ) . map ( playlist -> playlist . verify ( capabilities ) ) . orElse ( true ) ) { return false ; } return SelectorResource . isTarget ( eventModel , player ) . orElse ( false ) ; }
verifies that the StartMusicRequest is correct and checks whether the you are meant to react to it
@param eventModel the EventModel to check against
@param player the identifiable
@param capabilities the capabilities
@param activators the activators which are able to start the player if it is not able to start from outside commands
@return true if verified, false if not
verifies that the StartMusicRequest is correct and checks whether the you are meant to react to it