summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNick Hudson <nick.hudson@isode.com>2012-01-13 16:46:43 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-01-16 15:54:31 (GMT)
commit1c107332343c7ce4dadb02d69148d4232cebf965 (patch)
tree860718fd481b7c8c732d7fae13078b8bfe9a5a97 /src
parent903605ff58e7b75d6872a1ec14383971b128a876 (diff)
downloadstroke-1c107332343c7ce4dadb02d69148d4232cebf965.zip
stroke-1c107332343c7ce4dadb02d69148d4232cebf965.tar.bz2
Add "toString()" to a couple of classes
Just to help with debugging Test-information: Values appear as expected when running inside Eclipse debugger
Diffstat (limited to 'src')
-rw-r--r--src/com/isode/stroke/elements/Message.java5
-rw-r--r--src/com/isode/stroke/elements/RawXMLPayload.java5
-rw-r--r--src/com/isode/stroke/elements/Stanza.java6
3 files changed, 16 insertions, 0 deletions
diff --git a/src/com/isode/stroke/elements/Message.java b/src/com/isode/stroke/elements/Message.java
index 0266883..67903ae 100644
--- a/src/com/isode/stroke/elements/Message.java
+++ b/src/com/isode/stroke/elements/Message.java
@@ -53,4 +53,9 @@ public class Message extends Stanza {
public void setType(Type type) {
type_ = type;
}
+
+ @Override
+ public String toString() {
+ return "Message " + super.toString() + " subject=\"" + getSubject() + "\"";
+ }
}
diff --git a/src/com/isode/stroke/elements/RawXMLPayload.java b/src/com/isode/stroke/elements/RawXMLPayload.java
index b204fde..9700df7 100644
--- a/src/com/isode/stroke/elements/RawXMLPayload.java
+++ b/src/com/isode/stroke/elements/RawXMLPayload.java
@@ -22,4 +22,9 @@ public class RawXMLPayload extends Payload {
public String getRawXML() {
return rawXML_;
}
+
+ @Override
+ public String toString() {
+ return "RawXMLPayload : " + rawXML_ == null ? "<null>" : rawXML_;
+ }
}
diff --git a/src/com/isode/stroke/elements/Stanza.java b/src/com/isode/stroke/elements/Stanza.java
index 1746813..85b9d00 100644
--- a/src/com/isode/stroke/elements/Stanza.java
+++ b/src/com/isode/stroke/elements/Stanza.java
@@ -82,5 +82,11 @@ public class Stanza implements Element {
public void setID(String id) {
id_ = id;
}
+
+ @Override
+ public String toString() {
+ return "Stanza from \"" + from_ + "\" to \"" + to_ + "\"" +
+ " id=\"" + id_ + "\"";
+ }
}