From 89ee999e1b969a935d5b8ae9d7155ca9afe96389 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Mon, 10 Nov 2014 01:24:35 +0100 Subject: more refactoring for presence selection. removed getTo, getFrom and getJid from Element --- .../java/eu/siacs/conversations/xml/Element.java | 30 +++------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/xml/Element.java') 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 getAttributes() { return this.attributes; -- cgit v1.2.3