diff options
author | Nick Hudson <nick.hudson@isode.com> | 2012-01-16 12:14:02 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-01-18 11:03:48 (GMT) |
commit | 6665e38f97f95dd6e0fc574dc65a1be37b2b101f (patch) | |
tree | a780670c4a15abca042a0c75fa172b40b1808a22 /src/com/isode/stroke/client | |
parent | 839db071f46d083b86996f514f5fe0f2d6aee80a (diff) | |
download | stroke-6665e38f97f95dd6e0fc574dc65a1be37b2b101f.zip stroke-6665e38f97f95dd6e0fc574dc65a1be37b2b101f.tar.bz2 |
Add toString to some more classes
Also made "Stanza" be an abstract class and had its ".toString()" include
the name of the subclass which is involved, so that the subclasses don't
have to do that themselves.
Also added null check to existing HostAddress.toString() method
Also fixed Remko copyright in Connector class
Test-information:
Stuff is displayed as expected in debugger.
Diffstat (limited to 'src/com/isode/stroke/client')
-rw-r--r-- | src/com/isode/stroke/client/ClientOptions.java | 16 | ||||
-rw-r--r-- | src/com/isode/stroke/client/CoreClient.java | 7 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/com/isode/stroke/client/ClientOptions.java b/src/com/isode/stroke/client/ClientOptions.java index 99b3242..10dc8b3 100644 --- a/src/com/isode/stroke/client/ClientOptions.java +++ b/src/com/isode/stroke/client/ClientOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Isode Limited, London, England. + * Copyright (c) 2011-2012 Isode Limited, London, England. * All rights reserved. */ /* @@ -9,7 +9,7 @@ package com.isode.stroke.client; /** - * + * Options for a client connection */ public class ClientOptions { @@ -17,13 +17,22 @@ public class ClientOptions { NeverUseTLS, UseTLSWhenAvailable - }; + } public ClientOptions() { useStreamCompression = true; useTLS = UseTLS.UseTLSWhenAvailable; useStreamResumption = false; } + + @Override + public String toString() { + return + "useStreamCompression:" + useStreamCompression + + "; useStreamResumption:" + useStreamResumption + + "; " + useTLS; + } + /** * Whether ZLib stream compression should be used when available. * @@ -42,4 +51,5 @@ public class ClientOptions { * Default: false */ public boolean useStreamResumption; + } diff --git a/src/com/isode/stroke/client/CoreClient.java b/src/com/isode/stroke/client/CoreClient.java index cc9fd61..828906c 100644 --- a/src/com/isode/stroke/client/CoreClient.java +++ b/src/com/isode/stroke/client/CoreClient.java @@ -395,6 +395,13 @@ public class CoreClient { return jid_; } } + + @Override + public String toString() + { + return "CoreClient for \"" + jid_ + "\"" + + "; session " + (isAvailable() ? "" : "un") + "available"; + } /** * The user should add a listener to this signal, which will be called when |