Class DefaultSourcingResultFactory

java.lang.Object
de.hybris.platform.warehousing.sourcing.result.impl.DefaultSourcingResultFactory
All Implemented Interfaces:
SourcingResultFactory

public class DefaultSourcingResultFactory extends Object implements SourcingResultFactory
Factory used for creating a SourcingResult.
  • Constructor Details

    • DefaultSourcingResultFactory

      public DefaultSourcingResultFactory()
  • Method Details

    • create

      public SourcingResult create(AbstractOrderEntryModel orderEntry, SourcingLocation sourcingLocation, Long quantity)
      Description copied from interface: SourcingResultFactory
      Create a sourcing result.
      Specified by:
      create in interface SourcingResultFactory
      Parameters:
      orderEntry - the abstract order entry model
      sourcingLocation - the location from where to source the product.
      quantity - the quantity to source for this product and this location.
      Returns:
      the sourcing result
    • create

      public SourcingResult create(Collection<AbstractOrderEntryModel> orderEntries, SourcingLocation sourcingLocation)
      Description copied from interface: SourcingResultFactory
      Create a sourcing result where all order entries are sourced from the given sourcingLocation and using the quantity specified by AbstractOrderEntryModel#getQuantityUnallocated().
      Specified by:
      create in interface SourcingResultFactory
      Parameters:
      orderEntries - - the collection of abstract order entry model
      sourcingLocation - - the location from where to source the product
      Returns:
      the sourcing result
    • create

      public SourcingResult create(Map<AbstractOrderEntryModel,Long> allocations, SourcingLocation sourcingLocation)
      Description copied from interface: SourcingResultFactory
      Create a sourcing result where all order entries are sourced from the given sourcingLocation and using the quantity specified in the allocation map.
      Specified by:
      create in interface SourcingResultFactory
      Parameters:
      allocations - - the map of abstract order entry model and the quantity allocated
      sourcingLocation - - the location from where to source the product
      Returns:
      the sourcing result
    • create

      public SourcingResults create(Collection<SourcingResults> results)
      Description copied from interface: SourcingResultFactory
      Create a single sourcing result from a collection of sourcing results.
      Specified by:
      create in interface SourcingResultFactory
      Parameters:
      results - - the collection of sourcing results; should not be null
      Returns:
      the merged sourcing result; never null
    • mergeResults

      protected void mergeResults(SourcingResults source, SourcingResults target)
      Merges the sourcing results of the source and target results containers into the target container.
      This implementation will set the collections in the target as type HashSet and merges the collections using Iterables.concat(Iterable, Iterable).
      Parameters:
      source - - the source container
      target - - the target container