src/org/ohmage/validator/CampaignValidators.java
public static List<String> validateCampaignIds(final String campaignIds) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(campaignIds)) {
			return null;
		}
		
		Set<String> resultSet = new HashSet<String>();
		
		String[] campaignIdArray = campaignIds.split(InputKeys.LIST_ITEM_SEPARATOR);
		for(int i = 0; i < campaignIdArray.length; i++) {
			String campaignId = validateCampaignId(campaignIdArray[i].trim());
			
			if(campaignId != null) {
				resultSet.add(campaignId);
			}
		}
		
		if(resultSet.size() == 0) {
			return null;
		}
		else {
			return new ArrayList<String>(resultSet);
		}
	}
/**
	 * Validates that a String list of campaign identifiers is a valid list and
	 * each campaign identifier in the list is a valid identifier.
	 * 
	 * @param campaignIds A String list of campaign identifiers where each
	 * 					  identifier is separated by a 
	 * 					  {@value org.ohmage.request.InputKeys#LIST_ITEM_SEPARATOR}.
	 * 
	 * @return If the campaign IDs String list is null or whitespace only, null
	 * 		   is returned. Otherwise, a List of Strings is returned where each
	 * 		   String in the list represents a campaign identifier.
	 * 
	 * @throws ValidationException Thrown if the campaign ID list String is not
	 * 							   null, not whitespace only, and either cannot
	 * 							   be parced or can be parced but one of the 
	 * 							   values in the list is not a valid campaign
	 * 							   identifier. 
	 */
Validates that a String list of campaign identifiers is a valid list and
each campaign identifier in the list is a valid identifier.

@param campaignIds A String list of campaign identifiers where each
identifier is separated by a
org.ohmage.request.InputKeys#LIST_ITEM_SEPARATOR.

@return If the campaign IDs String list is null or whitespace only, null
is returned. Otherwise, a List of Strings is returned where each
String in the list represents a campaign identifier.

@throws ValidationException Thrown if the campaign ID list String is not
null, not whitespace only, and either cannot
be parced or can be parced but one of the
values in the list is not a valid campaign
identifier.
Validates that a String list of campaign identifiers is a valid list and each campaign identifier in the list is a valid identifier . @param campaignIds A String list of campaign identifiers where each identifier is separated by a org . ohmage . request . InputKeys#LIST_ITEM_SEPARATOR . @return If the campaign IDs String list is null or whitespace only null is returned . Otherwise a List of Strings is returned where each String in the list represents a campaign identifier . @throws ValidationException Thrown if the campaign ID list String is not null not whitespace only and either cannot be parced or can be parced but one of the values in the list is not a valid campaign identifier .
public static List<String> validateCampaignIds(final String campaignIds) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(campaignIds)) {
			return null;
		}
		Set<String> resultSet = new HashSet<String>();
		String[] campaignIdArray = campaignIds.split(InputKeys.LIST_ITEM_SEPARATOR);
		for(int i = 0; i < campaignIdArray.length; i++) {
			String campaignId = validateCampaignId(campaignIdArray[i].trim());
			if(campaignId != null) {
				resultSet.add(campaignId);
			}
		}
		if(resultSet.size() == 0) {
			return null;
		}
		else {
			return new ArrayList<String>(resultSet);
		}
	}
public static List < String > validateCampaignIds ( final String campaignIds ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( campaignIds ) ) { return null ; } Set < String > resultSet = new HashSet < String > ( ) ; String [ ] campaignIdArray = campaignIds . split ( InputKeys . LIST_ITEM_SEPARATOR ) ; for ( int i = 0 ; i < campaignIdArray . length ; i ++ ) { String campaignId = validateCampaignId ( campaignIdArray [ i ] . trim ( ) ) ; if ( campaignId != null ) { resultSet . add ( campaignId ) ; } } if ( resultSet . size ( ) == 0 ) { return null ; } else { return new ArrayList < String > ( resultSet ) ; } }
Validates that a String list of campaign identifiers is a valid list and
 each campaign identifier in the list is a valid identifier.
Validates that a String list of campaign identifiers is a valid list and each campaign identifier in the list is a valid identifier .