コード例 #1
0
 // Overload the method createInTransitContainer(BaseShipmentForm shipmentForm)
 public static StorageContainer createInTransitContainer(String containerName) {
   final StorageContainer container = new StorageContainer();
   // Set storage type for the container type being created
   final StorageType storageType = new StorageType();
   storageType.setName(Constants.SHIPMENT_CONTAINER_TYPE_NAME);
   container.setStorageType(storageType);
   // Set site for the container being created
   final Site site = new Site();
   site.setName(Constants.IN_TRANSIT_SITE_NAME);
   container.setSite(site);
   // Set capacity, create a container of dimensions (number of specimens to be stored) X 1
   final Capacity capacity = new Capacity();
   // Keep the capacity 1 initially and increment on adding a new specimen
   capacity.setOneDimensionCapacity(1);
   capacity.setTwoDimensionCapacity(1);
   container.setCapacity(capacity);
   container.setName(containerName);
   container.setSpecimenPositionCollection(new LinkedHashSet<SpecimenPosition>());
   return container;
 }
コード例 #2
0
 /**
  * creates the transit container.
  *
  * @param shipmentForm form containing all values.
  * @return object of StorageContainer class.
  */
 public static StorageContainer createInTransitContainer(BaseShipmentForm shipmentForm) {
   final StorageContainer container = new StorageContainer();
   // Set storage type for the container type being created
   final StorageType storageType = new StorageType();
   storageType.setName(Constants.SHIPMENT_CONTAINER_TYPE_NAME);
   container.setStorageType(storageType);
   // Set site for the container being created
   final Site site = new Site();
   site.setName(Constants.IN_TRANSIT_SITE_NAME);
   container.setSite(site);
   // Set capacity, create a container of dimensions (number of specimens to be stored) X 1
   final Capacity capacity = new Capacity();
   capacity.setOneDimensionCapacity(shipmentForm.getSpecimenCounter());
   capacity.setTwoDimensionCapacity(1);
   container.setCapacity(capacity);
   container.getHoldsSpecimenArrayTypeCollection();
   container.setName(Constants.IN_TRANSIT_CONTAINER_NAME_PREFIX + shipmentForm.getLabel());
   container.setSpecimenPositionCollection(new LinkedHashSet<SpecimenPosition>());
   return container;
 }