src/org/ohmage/domain/Clazz.java
public JSONObject toJson(boolean withId) throws JSONException {
		JSONObject result = new JSONObject();
		
		if(withId) {
			result.put(JSON_KEY_ID, id);
		}
		result.put(JSON_KEY_NAME, name);
		result.put(JSON_KEY_DESCRIPTION, description);
		result.put(JSON_KEY_REQUESTER_ROLE, requesterRole);
		
		return result;
	}
/**
	 * Returns this class object as a JSONObject with the URN as an optional
	 * inclusion.
	 * 
	 * @param withId Whether or not to include the URN in the output.
	 * 
	 * @return Returns a JSONObject with the classes as a JSONObject where the
	 * 		   keys are the users and their values are their class roles.
	 * 
	 * @throws JSONException Thrown if generating the object caused an error.
	 */
Returns this class object as a JSONObject with the URN as an optional
inclusion.

@param withId Whether or not to include the URN in the output.

@return Returns a JSONObject with the classes as a JSONObject where the
keys are the users and their values are their class roles.

@throws JSONException Thrown if generating the object caused an error.
Returns this class object as a JSONObject with the URN as an optional inclusion . @param withId Whether or not to include the URN in the output . @return Returns a JSONObject with the classes as a JSONObject where the keys are the users and their values are their class roles . @throws JSONException Thrown if generating the object caused an error .
public JSONObject toJson(boolean withId) throws JSONException {
		JSONObject result = new JSONObject();
		if(withId) {
			result.put(JSON_KEY_ID, id);
		}
		result.put(JSON_KEY_NAME, name);
		result.put(JSON_KEY_DESCRIPTION, description);
		result.put(JSON_KEY_REQUESTER_ROLE, requesterRole);
		return result;
	}
public JSONObject toJson ( boolean withId ) throws JSONException { JSONObject result = new JSONObject ( ) ; if ( withId ) { result . put ( JSON_KEY_ID , id ) ; } result . put ( JSON_KEY_NAME , name ) ; result . put ( JSON_KEY_DESCRIPTION , description ) ; result . put ( JSON_KEY_REQUESTER_ROLE , requesterRole ) ; return result ; }
Returns this class object as a JSONObject with the URN as an optional
 inclusion.
Returns this class object as a JSONObject with the URN as an optional inclusion .