@Override public Optional<DetailedSample> getEffectiveGroupIdSample() { for (DetailedSample sample = this; sample != null; sample = sample.getParent()) { String groupId = sample.getGroupId(); if (!LimsUtils.isStringEmptyOrNull(groupId)) return Optional.of(sample); } return Optional.empty(); }
aliquot.setGroupId(sample.getGroupId()); aliquot.setGroupDescription(sample.getGroupDescription()); aliquot.setSampleClass(sampleClassService.getAll().stream()
dto.setEffectiveGroupId(effective.get().getGroupId()); dto.setEffectiveGroupIdSample(effective.get().getAlias()); if (from.getGroupId() != null) { dto.setGroupId(from.getGroupId());
Optional<DetailedSample> effective = ((DetailedSample) from.getSample()).getEffectiveGroupIdSample(); effective.ifPresent(upstream -> { dto.setEffectiveGroupId(upstream.getGroupId()); dto.setEffectiveGroupIdSample(upstream.getAlias()); });
dTarget.setArchived(dSource.getArchived()); dTarget.setGroupDescription(dSource.getGroupDescription()); dTarget.setGroupId(dSource.getGroupId()); dTarget.setCreationDate(dSource.getCreationDate());