diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-11-09 15:20:06 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-11-09 15:20:06 +0100 |
commit | f65a2188cc8618ff155264ca0b85ed1a1dfa5491 (patch) | |
tree | 35cd4d707025252b36f5adcbc6af61545e4f03ec /src/main/java/eu/siacs/conversations/xmpp/jid/InvalidJidException.java | |
parent | 8c325dacf4be4028fbfdc1e175170237227c7e7e (diff) | |
parent | 53c7905631a9cee618157d15b06775c5d633f7a5 (diff) |
Merge pull request #639 from SamWhited/issue631
Use JID class instead of strings
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xmpp/jid/InvalidJidException.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/jid/InvalidJidException.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jid/InvalidJidException.java b/src/main/java/eu/siacs/conversations/xmpp/jid/InvalidJidException.java new file mode 100644 index 00000000..f1855263 --- /dev/null +++ b/src/main/java/eu/siacs/conversations/xmpp/jid/InvalidJidException.java @@ -0,0 +1,48 @@ +package eu.siacs.conversations.xmpp.jid; + +public class InvalidJidException extends Exception { + + // This is probably not the "Java way", but the "Java way" means we'd have a ton of extra tiny, + // annoying classes floating around. I like this. + public final static String INVALID_LENGTH = "JID must be between 0 and 3071 characters"; + public final static String INVALID_PART_LENGTH = "JID part must be between 0 and 1023 characters"; + public final static String INVALID_CHARACTER = "JID contains an invalid character"; + public final static String STRINGPREP_FAIL = "The STRINGPREP operation has failed for the given JID"; + + /** + * Constructs a new {@code Exception} that includes the current stack trace. + */ + public InvalidJidException() { + } + + /** + * Constructs a new {@code Exception} with the current stack trace and the + * specified detail message. + * + * @param detailMessage the detail message for this exception. + */ + public InvalidJidException(final String detailMessage) { + super(detailMessage); + } + + /** + * Constructs a new {@code Exception} with the current stack trace, the + * specified detail message and the specified cause. + * + * @param detailMessage the detail message for this exception. + * @param throwable the cause of this exception. + */ + public InvalidJidException(final String detailMessage, final Throwable throwable) { + super(detailMessage, throwable); + } + + /** + * Constructs a new {@code Exception} with the current stack trace and the + * specified cause. + * + * @param throwable the cause of this exception. + */ + public InvalidJidException(final Throwable throwable) { + super(throwable); + } +} |