OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2013 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 | |
11 package org.webrtc; | |
12 | |
13 /** | |
14 * Description of an RFC 4566 Session. | |
15 * SDPs are passed as serialized Strings in Java-land and are materialized | |
16 * to SessionDescriptionInterface as appropriate in the JNI layer. | |
17 */ | |
18 public class SessionDescription { | |
19 /** Java-land enum version of SessionDescriptionInterface's type() string. */ | |
20 public static enum Type { | |
21 OFFER, | |
22 PRANSWER, | |
23 ANSWER; | |
24 | |
25 public String canonicalForm() { | |
26 return name().toLowerCase(); | |
27 } | |
28 | |
29 public static Type fromCanonicalForm(String canonical) { | |
30 return Type.valueOf(Type.class, canonical.toUpperCase()); | |
31 } | |
32 } | |
33 | |
34 public final Type type; | |
35 public final String description; | |
36 | |
37 public SessionDescription(Type type, String description) { | |
38 this.type = type; | |
39 this.description = description; | |
40 } | |
41 } | |
OLD | NEW |