@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((alias == null) ? 0 : alias.hashCode()); result = prime * result + ((creationTime == null) ? 0 : creationTime.hashCode()); result = prime * result + ((creator == null) ? 0 : creator.hashCode()); result = prime * result + (int) (id ^ (id >>> 32)); result = prime * result + ((identificationBarcode == null) ? 0 : identificationBarcode.hashCode()); result = prime * result + ((locationUnit == null) ? 0 : locationUnit.hashCode()); result = prime * result + ((parentLocation == null) ? 0 : parentLocation.hashCode()); result = prime * result + ((mapUrl == null) ? 0 : mapUrl.hashCode()); result = prime * result + ((probeId == null) ? 0 : probeId.hashCode()); return result; }
if (box.getStorageLocation().getLocationUnit().getBoxStorageAmount() == BoxStorageAmount.NONE) { errors.add(new ValidationError("storageLocation", "Invalid box location")); } else if (box.getStorageLocation().getLocationUnit().getBoxStorageAmount() == BoxStorageAmount.SINGLE) { if (beforeChange == null || beforeChange.getStorageLocation() == null || beforeChange.getStorageLocation().getId() != box.getStorageLocation().getId()) {
dto.setParentLocationId(from.getParentLocation().getId()); dto.setLocationUnit(from.getLocationUnit().name()); switch (from.getLocationUnit().getBoxStorageAmount()) { case NONE: dto.setAvailableStorage(false);
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; }
public String getDisplayLocation() { return getLocationUnit().getDisplayName() + " " + getAlias(); }
private void validateLocationUnitRelationships(StorageLocation storage, List<ValidationError> errors) { if (storage.getParentLocation() != null && !storage.getLocationUnit().getAcceptableParents().contains(storage.getParentLocation().getLocationUnit())) { errors.add(new ValidationError(String.format("%s is not an appropriate container for %s", storage.getParentLocation().getLocationUnit().getDisplayName(), storage.getLocationUnit().getDisplayName()))); for (StorageLocation child : storage.getChildLocations()) { validateLocationUnitRelationships(child, errors); } } }