/** * assigns a document id to all attachments in the passed in collection based on the passed in * type to doc number map. * * @param <T> the type of attachments * @param attachments the collection of attachments that require doc number assignment * @param typeToDocNumber the map that contains all the highest doc numbers of existing * attachments based on type code */ private void assignDocumentId( List<SubAwardAttachments> attachments, final Map<String, Integer> typeToDocNumber) { for (SubAwardAttachments attachment : attachments) { if (attachment.isNew()) { final Integer nextDocNumber = SubAwardAttachmentFormBean.createNextDocNumber( typeToDocNumber.get(attachment.getSubAwardAttachmentTypeCode())); attachment.setDocumentId(nextDocNumber); } } }