Add JingleContentTransportInfo class

This commit is contained in:
vanitasvitae 2017-06-07 23:26:38 +02:00
parent acc98b4b2f
commit 9eba23c733
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
2 changed files with 26 additions and 0 deletions

View File

@ -31,20 +31,35 @@ public abstract class JingleContentTransport implements ExtensionElement {
public static final String ELEMENT = "transport"; public static final String ELEMENT = "transport";
protected final List<JingleContentTransportCandidate> candidates; protected final List<JingleContentTransportCandidate> candidates;
protected final List<JingleContentTransportInfo> infos;
protected JingleContentTransport(List<JingleContentTransportCandidate> candidates) { protected JingleContentTransport(List<JingleContentTransportCandidate> candidates) {
this(candidates, null);
}
protected JingleContentTransport(List<JingleContentTransportCandidate> candidates, List<JingleContentTransportInfo> infos) {
if (candidates != null) { if (candidates != null) {
this.candidates = Collections.unmodifiableList(candidates); this.candidates = Collections.unmodifiableList(candidates);
} }
else { else {
this.candidates = Collections.emptyList(); this.candidates = Collections.emptyList();
} }
if (infos != null) {
this.infos = infos;
} else {
this.infos = Collections.emptyList();
}
} }
public List<JingleContentTransportCandidate> getCandidates() { public List<JingleContentTransportCandidate> getCandidates() {
return candidates; return candidates;
} }
public List<JingleContentTransportInfo> getInfos() {
return infos;
}
@Override @Override
public String getElementName() { public String getElementName() {
return ELEMENT; return ELEMENT;
@ -66,6 +81,7 @@ public abstract class JingleContentTransport implements ExtensionElement {
xml.rightAngleBracket(); xml.rightAngleBracket();
xml.append(candidates); xml.append(candidates);
xml.append(infos);
xml.closeElement(this); xml.closeElement(this);
} }

View File

@ -0,0 +1,10 @@
package org.jivesoftware.smackx.jingle.element;
import org.jivesoftware.smack.packet.NamedElement;
/**
* Abstract JingleContentTransportInfo element.
*/
public abstract class JingleContentTransportInfo implements NamedElement {
}