public String getEmailsAsString(Message.RecipientType type) {

		Assert.notNull(type, "Missing recipient type!");
		Map<String, String> emailNames = emails.get(type);
		if (emailNames == null) {
			return null;
		}

		List<String> items = new ArrayList<>();
		for (String email : emailNames.keySet()) {

			String name = emailNames.get(email);
			if (StringUtils.isNullOrEmptyTrimmed(name) ||
			    StringUtils.equals(email, name, true)) {
				items.add(email);
			} else {
				items.add(name + " <" + email + ">");
			}
		}

		if (items.size() == 0) {
			return null;
		}

		return StringUtils.join(items, ", ");
	}
public String getEmailsAsString ( Message . RecipientType type ) { Assert . notNull ( type , "Missing recipient type!" ) ; Map < String , String > emailNames = emails . get ( type ) ; if ( emailNames == null ) { return null ; } List < String > items = new ArrayList < > ( ) ; for ( String email : emailNames . keySet ( ) ) { String name = emailNames . get ( email ) ; if ( StringUtils . isNullOrEmptyTrimmed ( name ) || StringUtils . equals ( email , name , true ) ) { items . add ( email ) ; } else { items . add ( name + " <" + email + ">" ) ; } } if ( items . size ( ) == 0 ) { return null ; } return StringUtils . join ( items , ", " ) ; }
@param type recipient type
@return emails formated as Bob &lt;bob@email.com&gt; separated with commas or null if empty