summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-01-12 16:48:02 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-01-16 15:54:31 (GMT)
commit839db071f46d083b86996f514f5fe0f2d6aee80a (patch)
tree9f14beb42dcd82fa4deba10f516a0ba0368e57b5 /src/com/isode/stroke/parser/Attribute.java
parent3adee817bfcbd54fd13c4d946bedadeca661e9b1 (diff)
downloadstroke-839db071f46d083b86996f514f5fe0f2d6aee80a.zip
stroke-839db071f46d083b86996f514f5fe0f2d6aee80a.tar.bz2
Add support for DiscoItems and DiscoInfo.
Updates requisite classes in line with Swiften. Also fixes bugs in the EventLoops not using handleEvent.
Diffstat (limited to 'src/com/isode/stroke/parser/Attribute.java')
-rw-r--r--src/com/isode/stroke/parser/Attribute.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/com/isode/stroke/parser/Attribute.java b/src/com/isode/stroke/parser/Attribute.java
new file mode 100644
index 0000000..d624550
--- /dev/null
+++ b/src/com/isode/stroke/parser/Attribute.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2012, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tronçon.
+ * All rights reserved.
+ */
+package com.isode.stroke.parser;
+
+/*
+ * Internal parsing class.
+ */
+public class Attribute {
+
+ public Attribute(String name, String ns) {
+ this.name = name;
+ this.ns = ns;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getNamespace() {
+ return ns;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ return other != null
+ && other instanceof Attribute
+ && name.equals(((Attribute) other).getName())
+ && ns.equals(((Attribute) other).getNamespace());
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 3;
+ hash = 19 * hash + (this.name != null ? this.name.hashCode() : 0);
+ hash = 19 * hash + (this.ns != null ? this.ns.hashCode() : 0);
+ return hash;
+ }
+ private final String name;
+ private final String ns;
+}