private void applyChanges(Workset from, Workset to) throws IOException { to.setAlias(from.getAlias()); to.setDescription(from.getDescription()); applyMemberChanges(from, to); }
public static Workset to(@Nonnull WorksetDto from) { Workset workset = new Workset(); if (from.getId() != null) { workset.setId(from.getId()); } workset.setAlias(from.getAlias()); workset.setDescription(from.getDescription()); if (from.getSampleIds() != null && !from.getSampleIds().isEmpty()) { workset.setSamples(from.getSampleIds().stream().map(id -> { Sample s = new SampleImpl(); s.setId(id); return s; }).collect(Collectors.toSet())); } if (from.getLibraryIds() != null && !from.getLibraryIds().isEmpty()) { workset.setLibraries(from.getLibraryIds().stream().map(id -> { Library l = new LibraryImpl(); l.setId(id); return l; }).collect(Collectors.toSet())); } if (from.getDilutionIds() != null && !from.getDilutionIds().isEmpty()) { workset.setDilutions(from.getDilutionIds().stream().map(id -> { LibraryDilution d = new LibraryDilution(); d.setId(id); return d; }).collect(Collectors.toSet())); } return workset; }