blob: 8ecf0ff11e31f51873d6d36e5cd0871f867972b7 [file] [log] [blame]
Benjamin Wright728b9b52018-07-03 13:28:34 -07001/*
2 * Copyright 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11package org.webrtc;
12
13import javax.annotation.Nullable;
14
15/**
16 * PeerConnectionDependencies holds all PeerConnection dependencies that are
17 * applied per PeerConnection. A dependency is distinct from a configuration
18 * as it defines significant executable code that can be provided by a user of
19 * the API.
20 */
21public final class PeerConnectionDependencies {
22 // Mandatory dependencies.
23 private PeerConnection.Observer observer;
24
25 public static class Builder {
26 private PeerConnection.Observer observer;
27
28 private Builder(PeerConnection.Observer observer) {
29 this.observer = observer;
30 }
31
32 // Observer is a required dependency and so is forced in the construction of the object.
33 public PeerConnectionDependencies createPeerConnectionDependencies() {
34 return new PeerConnectionDependencies(observer);
35 }
36 }
37
38 public static Builder builder(PeerConnection.Observer observer) {
39 return new Builder(observer);
40 }
41
42 PeerConnection.Observer getObserver() {
43 return observer;
44 }
45
46 private PeerConnectionDependencies(PeerConnection.Observer observer) {
47 this.observer = observer;
48 }
49}