XmppUri: Add toString() method

This commit is contained in:
Marc Schink 2018-02-14 16:51:31 +01:00
parent af778b0f4b
commit c7d2b65982
1 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import eu.siacs.conversations.xmpp.jid.Jid;
public class XmppUri { public class XmppUri {
protected Uri uri;
protected String jid; protected String jid;
protected List<Fingerprint> fingerprints = new ArrayList<>(); protected List<Fingerprint> fingerprints = new ArrayList<>();
private String body; private String body;
@ -52,6 +53,7 @@ public class XmppUri {
} }
protected void parse(Uri uri) { protected void parse(Uri uri) {
this.uri = uri;
String scheme = uri.getScheme(); String scheme = uri.getScheme();
String host = uri.getHost(); String host = uri.getHost();
List<String> segments = uri.getPathSegments(); List<String> segments = uri.getPathSegments();
@ -111,6 +113,13 @@ public class XmppUri {
} }
} }
public String toString() {
if (uri != null) {
return uri.toString();
}
return "";
}
protected List<Fingerprint> parseFingerprints(String query) { protected List<Fingerprint> parseFingerprints(String query) {
return parseFingerprints(query,';'); return parseFingerprints(query,';');
} }