diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-11-10 01:24:35 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-11-10 01:24:35 +0100 |
commit | 89ee999e1b969a935d5b8ae9d7155ca9afe96389 (patch) | |
tree | 3658c68b199eb7e325c0ebd7810381d078a9859f /src/main/java/eu/siacs/conversations/xml | |
parent | 26b4788733d9e9e5267bb6b54bb847757c7c25e5 (diff) |
more refactoring for presence selection. removed getTo, getFrom and getJid from Element
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xml')
-rw-r--r-- | src/main/java/eu/siacs/conversations/xml/Element.java | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/main/java/eu/siacs/conversations/xml/Element.java b/src/main/java/eu/siacs/conversations/xml/Element.java index 31edec52..02c3e695 100644 --- a/src/main/java/eu/siacs/conversations/xml/Element.java +++ b/src/main/java/eu/siacs/conversations/xml/Element.java @@ -105,8 +105,8 @@ public class Element { } } - public Jid getJid() { - final String jid = this.getAttribute("jid"); + public Jid getAttributeAsJid(String name) { + final String jid = this.getAttribute(name); if (jid != null && !jid.isEmpty()) { try { return Jid.fromString(jid); @@ -115,31 +115,7 @@ public class Element { } } return null; - } - - public Jid getTo() { - final String to = this.getAttribute("to"); - if (to != null && !to.isEmpty()) { - try { - return Jid.fromString(to); - } catch (final InvalidJidException e) { - return null; - } - } - return null; - } - - public Jid getFrom() { - final String from = this.getAttribute("from"); - if (from != null && !from.isEmpty()) { - try { - return Jid.fromString(from); - } catch (final InvalidJidException e) { - return null; - } - } - return null; - } + } public Hashtable<String, String> getAttributes() { return this.attributes; |