addSubscription(subscription) {
                if (!subscription instanceof Subscription) throw new Error("Expected a Subscription");
                if (this.hasSubscription(subscription)) {
                    log(LOG_LEVEL.WARNING, "WARNING: Could not create Subscription: " + subscription.getSubscriptionString() + " because it already exists.");
                    return undefined;
                }
                this.updateFromStore();
                this._subscriptions.push(subscription);
                log(LOG_LEVEL.VERBOSE, "VERBOSE: Added Subscription: " + subscription.getSubscriptionString() + " to SubscriptionStore.");
                this.saveToStore();
                log(LOG_LEVEL.INFO, "INFO: Saved and Created new Subscription: '" + subscription.getSubscriptionString() + "'.");
                return subscription;
            }
/**
             * Adds a subscription to the storage.
             * @param {Subscription} subscription - the subscription which should be stored.
             * @returns {Subscription} returns the added subscription or undefined if it already exists.
             */
Adds a subscription to the storage.
@param {Subscription} subscription - the subscription which should be stored.
@returns {Subscription} returns the added subscription or undefined if it already exists.
Adds a subscription to the storage . @param { Subscription } subscription - the subscription which should be stored . @returns { Subscription } returns the added subscription or undefined if it already exists .
addSubscription(subscription) {
                if (!subscription instanceof Subscription) throw new Error("Expected a Subscription");
                if (this.hasSubscription(subscription)) {
                    log(LOG_LEVEL.WARNING, "WARNING: Could not create Subscription: " + subscription.getSubscriptionString() + " because it already exists.");
                    return undefined;
                }
                this.updateFromStore();
                this._subscriptions.push(subscription);
                log(LOG_LEVEL.VERBOSE, "VERBOSE: Added Subscription: " + subscription.getSubscriptionString() + " to SubscriptionStore.");
                this.saveToStore();
                log(LOG_LEVEL.INFO, "INFO: Saved and Created new Subscription: '" + subscription.getSubscriptionString() + "'.");
                return subscription;
            }
addSubscription ( subscription ) { if ( ! subscription instanceof Subscription ) throw new Error ( "Expected a Subscription" ) ; if ( this . hasSubscription ( subscription ) ) { log ( LOG_LEVEL . WARNING , "WARNING: Could not create Subscription: " + subscription . getSubscriptionString ( ) + " because it already exists." ) ; return undefined ; } this . updateFromStore ( ) ; this . _subscriptions . push ( subscription ) ; log ( LOG_LEVEL . VERBOSE , "VERBOSE: Added Subscription: " + subscription . getSubscriptionString ( ) + " to SubscriptionStore." ) ; this . saveToStore ( ) ; log ( LOG_LEVEL . INFO , "INFO: Saved and Created new Subscription: '" + subscription . getSubscriptionString ( ) + "'." ) ; return subscription ; }
Adds a subscription to the storage.
Adds a subscription to the storage .