private void applyChanges(StorageLocation from, StorageLocation to) { to.setAlias(from.getAlias()); to.setIdentificationBarcode(from.getIdentificationBarcode()); to.setParentLocation(from.getParentLocation()); to.setMapUrl(from.getMapUrl()); to.setProbeId(from.getProbeId()); }
public static StorageLocation to(@Nonnull StorageLocationDto from) { StorageLocation location = new StorageLocation(); location.setId(from.getId()); location.setAlias(from.getAlias()); if (!LimsUtils.isStringEmptyOrNull(from.getIdentificationBarcode())) { location.setIdentificationBarcode(from.getIdentificationBarcode()); } if (!LimsUtils.isStringEmptyOrNull(from.getMapUrl())) { location.setMapUrl(from.getMapUrl()); } if (from.getParentLocationId() != null) { location.setParentLocation(new StorageLocation()); location.getParentLocation().setId(from.getParentLocationId()); } location.setLocationUnit(LocationUnit.valueOf(from.getLocationUnit())); location.setProbeId(from.getProbeId()); return location; }