From d49dc71baea6756faf6b6cb081a6e65820ad0c2e Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Thu, 8 Jun 2017 15:04:25 +0200 Subject: [PATCH] Add JingleContentTransportInfo class --- .../element/JingleContentTransport.java | 16 ++++++++++++ .../element/JingleContentTransportInfo.java | 26 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContentTransportInfo.java diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContentTransport.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContentTransport.java index de8213ca1..156caf3cd 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContentTransport.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContentTransport.java @@ -31,20 +31,35 @@ public abstract class JingleContentTransport implements ExtensionElement { public static final String ELEMENT = "transport"; protected final List candidates; + protected final List infos; protected JingleContentTransport(List candidates) { + this(candidates, null); + } + + protected JingleContentTransport(List candidates, List infos) { if (candidates != null) { this.candidates = Collections.unmodifiableList(candidates); } else { this.candidates = Collections.emptyList(); } + + if (infos != null) { + this.infos = infos; + } else { + this.infos = Collections.emptyList(); + } } public List getCandidates() { return candidates; } + public List getInfos() { + return infos; + } + @Override public String getElementName() { return ELEMENT; @@ -66,6 +81,7 @@ public abstract class JingleContentTransport implements ExtensionElement { xml.rightAngleBracket(); xml.append(candidates); + xml.append(infos); xml.closeElement(this); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContentTransportInfo.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContentTransportInfo.java new file mode 100644 index 000000000..6e1680046 --- /dev/null +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContentTransportInfo.java @@ -0,0 +1,26 @@ +/** + * + * Copyright 2017 Paul Schaub + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jivesoftware.smackx.jingle.element; + +import org.jivesoftware.smack.packet.NamedElement; + +/** + * Abstract JingleContentTransportInfo element. + */ +public abstract class JingleContentTransportInfo implements NamedElement { + +}