mayAddSink_(sink) {
    this.logger_.fine('mayAddSink, id = ' + sink.getId());
    const sinkToUpdate = this.sinkMap_.get(sink.getId());
    if (sinkToUpdate) {
      if (sinkToUpdate.update(sink)) {
        this.logger_.fine('Updated sink ' + sinkToUpdate.getId());
        this.sinkCallBacks_.onSinkUpdated(sinkToUpdate);
      }
    } else {
      this.logger_.fine(
          () => `Adding new sink ${sink.getId()}: ${sink.toDebugString()}`);
      this.sinkMap_.set(sink.getId(), sink);
      this.sinkCallBacks_.onSinkAdded(sink);
    }
  }
/**
   * Adds or updates an existing sink with the given sink.
   * @param {!DialSink} sink The new or updated sink.
   * @private
   */
Adds or updates an existing sink with the given sink.
@param {!DialSink} sink The new or updated sink.
@private
Adds or updates an existing sink with the given sink . @param { !DialSink } sink The new or updated sink . @private
mayAddSink_(sink) {
    this.logger_.fine('mayAddSink, id = ' + sink.getId());
    const sinkToUpdate = this.sinkMap_.get(sink.getId());
    if (sinkToUpdate) {
      if (sinkToUpdate.update(sink)) {
        this.logger_.fine('Updated sink ' + sinkToUpdate.getId());
        this.sinkCallBacks_.onSinkUpdated(sinkToUpdate);
      }
    } else {
      this.logger_.fine(
          () => `Adding new sink ${sink.getId()}: ${sink.toDebugString()}`);
      this.sinkMap_.set(sink.getId(), sink);
      this.sinkCallBacks_.onSinkAdded(sink);
    }
  }
mayAddSink_ ( sink ) { this . logger_ . fine ( 'mayAddSink, id = ' + sink . getId ( ) ) ; const sinkToUpdate = this . sinkMap_ . get ( sink . getId ( ) ) ; if ( sinkToUpdate ) { if ( sinkToUpdate . update ( sink ) ) { this . logger_ . fine ( 'Updated sink ' + sinkToUpdate . getId ( ) ) ; this . sinkCallBacks_ . onSinkUpdated ( sinkToUpdate ) ; } } else { this . logger_ . fine ( ( ) => ` ${ sink . getId ( ) } ${ sink . toDebugString ( ) } ` ) ; this . sinkMap_ . set ( sink . getId ( ) , sink ) ; this . sinkCallBacks_ . onSinkAdded ( sink ) ; } }
Adds or updates an existing sink with the given sink.
Adds or updates an existing sink with the given sink .