public static String makeLocationLabel(Boxable boxable) { return makeLocationLabel(boxable.isDiscarded(), boxable.getLocationBarcode(), boxable.getBox() == null ? null : boxable.getBox().getAlias(), boxable.getBoxPosition(), boxable.getBox() == null ? null : boxable.getBox().getLocationBarcode()); }
private void applyChanges(Box from, Box to) throws IOException { to.setAlias(from.getAlias()); to.setDescription(from.getDescription()); to.setIdentificationBarcode(LimsUtils.nullifyStringIfBlank(from.getIdentificationBarcode())); to.setLocationBarcode(from.getLocationBarcode()); to.setUse(boxStore.getUseById(from.getUse().getId())); to.setStorageLocation(from.getStorageLocation()); }
public static BoxDto asDto(@Nonnull Box from, boolean includePositions) { BoxDto dto = new BoxDto(); dto.setId(from.getId()); dto.setName(from.getName()); dto.setAlias(from.getAlias()); dto.setDescription(from.getDescription()); dto.setIdentificationBarcode(from.getIdentificationBarcode()); dto.setLocationBarcode(from.getLocationBarcode()); if (from.getUse() != null) { dto.setUseId(from.getUse().getId()); dto.setUseAlias(from.getUse().getAlias()); } if (from.getSize() != null) { dto.setSizeId(from.getSize().getId()); dto.setRows(from.getSize().getRows()); dto.setCols(from.getSize().getColumns()); dto.setScannable(from.getSize().getScannable()); } if (includePositions) { dto.setItems(from.getBoxPositions().values().stream().map(Dtos::asDto).collect(Collectors.toList())); } if (from.getStorageLocation() != null) { dto.setStorageLocationId(from.getStorageLocation().getId()); dto.setStorageLocationBarcode(from.getStorageLocation().getIdentificationBarcode()); dto.setFreezerDisplayLocation(from.getStorageLocation().getFreezerDisplayLocation()); dto.setStorageDisplayLocation(from.getStorageLocation().getFullDisplayLocation()); } dto.setTubeCount(from.getTubeCount()); return dto; }
public static BoxableView fromBoxable(Boxable boxable) { BoxableView v = new BoxableView(); v.setId(new BoxableId(boxable.getEntityType(), boxable.getId())); v.setName(boxable.getName()); v.setAlias(boxable.getAlias()); v.setIdentificationBarcode(boxable.getIdentificationBarcode()); v.setLocationBarcode(boxable.getLocationBarcode()); v.setVolume(boxable.getVolume()); v.setDiscarded(boxable.isDiscarded()); Box box = boxable.getBox(); if (box != null) { v.setBoxId(box.getId()); v.setBoxName(box.getName()); v.setBoxAlias(box.getAlias()); v.setBoxPosition(boxable.getBoxPosition()); v.setBoxLocationBarcode(box.getLocationBarcode()); } v.setPreMigrationId(boxable.getPreMigrationId()); return v; }
v.setBoxAlias(dilution.getBox().getAlias()); v.setBoxIdentificationBarcode(dilution.getBox().getIdentificationBarcode()); v.setBoxLocationBarcode(dilution.getBox().getLocationBarcode());