src/org/ohmage/domain/UserInformation.java
public void addClass(
			final String classId, 
			final Clazz.Role role)
			throws DomainException {
		
		if(classId == null) {
			throw new DomainException("The class ID is null.");
		}
		
		if(role == null) {
			throw new DomainException("The role is null.");
		}
		
		if(classes == null) {
			classes = new HashMap<String, Clazz.Role>();
		}
		
		classes.put(classId, role);
	}
/**
	 * Adds a class, if it doesn't already exist, and a role for the user. If a
	 * role already existed for this user in this class, it is overwritten.
	 * 
	 * @param classId The class' unique identifier.
	 * 
	 * @param role The users role in the class.
	 * 
	 * @throws DomainException The class ID or role were null.
	 */
Adds a class, if it doesn't already exist, and a role for the user. If a
role already existed for this user in this class, it is overwritten.

@param classId The class' unique identifier.

@param role The users role in the class.

@throws DomainException The class ID or role were null.
Adds a class if it doesn ' t already exist and a role for the user . If a role already existed for this user in this class it is overwritten . @param classId The class ' unique identifier . @param role The users role in the class . @throws DomainException The class ID or role were null .
public void addClass(
			final String classId, 
			final Clazz.Role role)
			throws DomainException {
		if(classId == null) {
			throw new DomainException("The class ID is null.");
		}
		if(role == null) {
			throw new DomainException("The role is null.");
		}
		if(classes == null) {
			classes = new HashMap<String, Clazz.Role>();
		}
		classes.put(classId, role);
	}
public void addClass ( final String classId , final Clazz . Role role ) throws DomainException { if ( classId == null ) { throw new DomainException ( "The class ID is null." ) ; } if ( role == null ) { throw new DomainException ( "The role is null." ) ; } if ( classes == null ) { classes = new HashMap < String , Clazz . Role > ( ) ; } classes . put ( classId , role ) ; }
Adds a class, if it doesn't already exist, and a role for the user.
Adds a class if it doesn ' t already exist and a role for the user .