blob: b03f1a3677749145a0bb57f689b22d1cc3a1631c [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * 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.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00009 */
10
11package org.webrtc;
12
13/**
14 * Representation of a single ICE Candidate, mirroring
15 * {@code IceCandidateInterface} in the C++ API.
16 */
17public class IceCandidate {
18 public final String sdpMid;
19 public final int sdpMLineIndex;
20 public final String sdp;
zhihuang8e32cd22017-02-17 12:45:00 -080021 public final String serverUrl;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000022
deadbeefb8567942017-02-13 14:31:38 -080023 public IceCandidate(String sdpMid, int sdpMLineIndex, String sdp) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +000024 this.sdpMid = sdpMid;
25 this.sdpMLineIndex = sdpMLineIndex;
26 this.sdp = sdp;
zhihuang8e32cd22017-02-17 12:45:00 -080027 this.serverUrl = "";
28 }
29
30 // Only be called internally from JNI.
31 private IceCandidate(String sdpMid, int sdpMLineIndex, String sdp, String serverUrl) {
32 this.sdpMid = sdpMid;
33 this.sdpMLineIndex = sdpMLineIndex;
34 this.sdp = sdp;
35 this.serverUrl = serverUrl;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000036 }
37
Sami Kalliomäkibde473e2017-10-30 13:34:41 +010038 @Override
henrike@webrtc.org28e20752013-07-10 00:45:36 +000039 public String toString() {
zhihuang8e32cd22017-02-17 12:45:00 -080040 return sdpMid + ":" + sdpMLineIndex + ":" + sdp + ":" + serverUrl;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000041 }
42}