Class DefaultSourcingResultFactory
- java.lang.Object
-
- de.hybris.platform.warehousing.sourcing.result.impl.DefaultSourcingResultFactory
-
- All Implemented Interfaces:
SourcingResultFactory
public class DefaultSourcingResultFactory extends java.lang.Object implements SourcingResultFactory
Factory used for creating aSourcingResult.
-
-
Constructor Summary
Constructors Constructor Description DefaultSourcingResultFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SourcingResultcreate(AbstractOrderEntryModel orderEntry, SourcingLocation sourcingLocation, java.lang.Long quantity)Create a sourcing result.SourcingResultcreate(java.util.Collection<AbstractOrderEntryModel> orderEntries, SourcingLocation sourcingLocation)Create a sourcing result where all order entries are sourced from the given sourcingLocation and using the quantity specified byAbstractOrderEntryModel#getQuantityUnallocated().SourcingResultscreate(java.util.Collection<SourcingResults> results)Create a single sourcing result from a collection of sourcing results.SourcingResultcreate(java.util.Map<AbstractOrderEntryModel,java.lang.Long> allocations, SourcingLocation sourcingLocation)Create a sourcing result where all order entries are sourced from the given sourcingLocation and using the quantity specified in the allocation map.protected voidmergeResults(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 typeHashSetand merges the collections usingIterables.concat(Iterable, Iterable).
-
-
-
Method Detail
-
create
public SourcingResult create(AbstractOrderEntryModel orderEntry, SourcingLocation sourcingLocation, java.lang.Long quantity)
Description copied from interface:SourcingResultFactoryCreate a sourcing result.- Specified by:
createin interfaceSourcingResultFactory- Parameters:
orderEntry- the abstract order entry modelsourcingLocation- 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(java.util.Collection<AbstractOrderEntryModel> orderEntries, SourcingLocation sourcingLocation)
Description copied from interface:SourcingResultFactoryCreate a sourcing result where all order entries are sourced from the given sourcingLocation and using the quantity specified byAbstractOrderEntryModel#getQuantityUnallocated().- Specified by:
createin interfaceSourcingResultFactory- Parameters:
orderEntries- - the collection of abstract order entry modelsourcingLocation- - the location from where to source the product- Returns:
- the sourcing result
-
create
public SourcingResult create(java.util.Map<AbstractOrderEntryModel,java.lang.Long> allocations, SourcingLocation sourcingLocation)
Description copied from interface:SourcingResultFactoryCreate a sourcing result where all order entries are sourced from the given sourcingLocation and using the quantity specified in the allocation map.- Specified by:
createin interfaceSourcingResultFactory- Parameters:
allocations- - the map of abstract order entry model and the quantity allocatedsourcingLocation- - the location from where to source the product- Returns:
- the sourcing result
-
create
public SourcingResults create(java.util.Collection<SourcingResults> results)
Description copied from interface:SourcingResultFactoryCreate a single sourcing result from a collection of sourcing results.- Specified by:
createin interfaceSourcingResultFactory- 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 typeHashSetand merges the collections usingIterables.concat(Iterable, Iterable).- Parameters:
source- - the source containertarget- - the target container
-
-