public static Optional<CommandResource> createCommandResource(Identification provider, String command, Capabilities capabilities, Context context) {
        CommandResource commandResource = new CommandResource(provider, command, capabilities);
        if (!verifyCommand(command)) {
            context.getLogger().error("IllegalCommand!");
            return Optional.empty();
        }
        if (!verifyCapabilities(command, capabilities)) {
            context.getLogger().error("Player is not able to handle Command!");
            return Optional.empty();
        }
        return Optional.of(commandResource);
    }
public static Optional < CommandResource > createCommandResource ( Identification provider , String command , Capabilities capabilities , Context context ) { CommandResource commandResource = new CommandResource ( provider , command , capabilities ) ; if ( ! verifyCommand ( command ) ) { context . getLogger ( ) . error ( "IllegalCommand!" ) ; return Optional . empty ( ) ; } if ( ! verifyCapabilities ( command , capabilities ) ) { context . getLogger ( ) . error ( "Player is not able to handle Command!" ) ; return Optional . empty ( ) ; } return Optional . of ( commandResource ) ; }
creates a new Resource.

@param provider   the Provider of the Resource
@param command          the resource
@param capabilities the capabilities of the player
@param context used for logging
@return the commandResource if nothing illegal was passed