public String getDisplayLocation() { return getLocationUnit().getDisplayName() + " " + getAlias(); }
private StorageLocation getFreezer(Box box) { if (box.getStorageLocation() == null) { throw new IllegalArgumentException(String.format("%s (%s) does not have a storage location", box.getAlias(), box.getName())); } StorageLocation location = box.getStorageLocation().getFreezerLocation(); if (location == null) { throw new IllegalArgumentException(String.format("Location %s does not have a parent freezer", box.getStorageLocation().getAlias())); } return location; }
/** * Add a changelog entry to record a Box added to or removed from a StorageLocation * * @param location the StorageLocation that box was added to or removed from * @param box the Box that was added or removed * @param addition true for addition; false for removal * @throws IOException */ private void addStorageChangeLog(StorageLocation location, Box box, boolean addition) throws IOException { if (location.getLocationUnit() != LocationUnit.FREEZER) { throw new IllegalArgumentException(String.format("%s is not a freezer", location.getAlias())); } String message = addition ? String.format("Added %s (%s) to %s", box.getAlias(), box.getName(), box.getStorageLocation().getFreezerDisplayLocation()) : (String.format("Removed %s (%s)", box.getAlias(), box.getName())); ChangeLog change = location.createChangeLog(message, "", authorizationManager.getCurrentUser()); changeLogService.create(change); }
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()); }
throw new IllegalStateException("Unexpected BoxStorageAmount"); dto.setAlias(from.getAlias()); dto.setIdentificationBarcode(from.getIdentificationBarcode()); dto.setDisplayLocation(from.getDisplayLocation());