final List<JobDefinitionResource> maskedContents = new ArrayList<JobDefinitionResource>(
pagedResources.getContent().size());
for (JobDefinitionResource jobDefinitionResource : pagedResources.getContent()) {
jobDefinitionResource.getDefinition();
JobDefinitionResource maskedJobDefinitionResource =
new JobDefinitionResource(jobDefinitionResource.getName(),
PasswordUtils.maskPasswordsInDefinition(jobDefinitionResource.getDefinition()));
maskedJobDefinitionResource.setStatus(jobDefinitionResource.getStatus());
maskedContents.add(maskedJobDefinitionResource);
}
return new PagedResources<JobDefinitionResource>(maskedContents, pagedResources.getMetadata(),
pagedResources.getLinks());