public static BundleRevisionDTO[] newArrayBundleRevisionDTO(BundleRevisions revisions) { if (revisions == null) { return null; } List<BundleRevision> revs = revisions.getRevisions(); final int size = revs.size(); BundleRevisionDTO[] dtos = new BundleRevisionDTO[size]; for (int i = 0; i < size; i++) { dtos[i] = new DTOBuilder().getBundleRevisionDTO(revs.get(i)); } return dtos; }
public static BundleWiringDTO[] newArrayBundleWiringDTO(BundleRevisions revisions) { if (revisions == null) { return null; } List<BundleRevision> revs = revisions.getRevisions(); final int size = revs.size(); List<BundleWiringDTO> dtos = new ArrayList<BundleWiringDTO>(size); for (int i = 0; i < size; i++) { BundleWiring wiring = revs.get(i).getWiring(); if (wiring != null) { dtos.add( new DTOBuilder().getBundleWiringDTO(wiring)); // use new DTOBuilder for each wiring dto } } return dtos.toArray(new BundleWiringDTO[dtos.size()]); }