You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by ng...@apache.org on 2009/08/16 22:41:17 UTC
svn commit: r804770 -
/mina/sandbox/vysper/trunk/server/extensions/xep0045-muc/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0045_muc/model/Occupant.java
Author: ngn
Date: Sun Aug 16 20:41:17 2009
New Revision: 804770
URL: http://svn.apache.org/viewvc?rev=804770&view=rev
Log:
Add null checks in constructor and toString
Modified:
mina/sandbox/vysper/trunk/server/extensions/xep0045-muc/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0045_muc/model/Occupant.java
Modified: mina/sandbox/vysper/trunk/server/extensions/xep0045-muc/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0045_muc/model/Occupant.java
URL: http://svn.apache.org/viewvc/mina/sandbox/vysper/trunk/server/extensions/xep0045-muc/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0045_muc/model/Occupant.java?rev=804770&r1=804769&r2=804770&view=diff
==============================================================================
--- mina/sandbox/vysper/trunk/server/extensions/xep0045-muc/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0045_muc/model/Occupant.java (original)
+++ mina/sandbox/vysper/trunk/server/extensions/xep0045-muc/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0045_muc/model/Occupant.java Sun Aug 16 20:41:17 2009
@@ -35,6 +35,11 @@
private String name;
public Occupant(Entity jid, String name, Affiliation affiliation, Role role) {
+ if(jid == null) throw new IllegalArgumentException("JID can not be null");
+ if(name == null) throw new IllegalArgumentException("Name can not be null");
+ if(affiliation == null) throw new IllegalArgumentException("Affiliation can not be null");
+ if(role == null) throw new IllegalArgumentException("Role can not be null");
+
this.jid = jid;
this.name = name;
this.affiliation = affiliation;
@@ -73,5 +78,9 @@
return role == Role.Moderator || role == Role.Participant;
}
+ @Override
+ public String toString() {
+ return jid.getFullQualifiedName();
+ }
}