Class SourcingLocationBuilder
- java.lang.Object
-
- de.hybris.platform.warehousing.sourcing.util.SourcingLocationBuilder
-
- All Implemented Interfaces:
Builder<SourcingLocation>
public class SourcingLocationBuilder extends java.lang.Object implements Builder<SourcingLocation>
This is a Sourcing location builder implementation of the Builder interface
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.DoubleDEFAULT_DISTANCEstatic java.lang.IntegerDEFAULT_INITIAL_IDstatic java.lang.IntegerDEFAULT_PRIORITYstatic java.lang.StringDEFAULT_SKUstatic java.lang.LongDEFAULT_SKU_QUANTITY
-
Constructor Summary
Constructors Constructor Description SourcingLocationBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SourcingLocationBuilderaSourcingLocation()SourcingLocationbuild()Builds an instance of type T (e.g., a SourcingLocation, a FitnessContext, ...)SourcingLocationBuilderwithAvailability(java.util.Map<ProductModel,java.lang.Long> availability)SourcingLocationBuilderwithContext(SourcingContext context)SourcingLocationBuilderwithCustomAvailabilityProductQuantity(ProductModel productModel, java.lang.Long quantity)Adds an existingProductModelof the specified quantity to the location to be builtSourcingLocationBuilderwithCustomAvailabilitySkuQuantity(java.lang.String SKUId, java.lang.Long quantity)Adds a newProductModelof the specified SKU and quantity to the location to be builtSourcingLocationBuilderwithDefaultAvailabilityQuantity(java.lang.Long quantity)Adds a new Product of the default SKU and the specified quantity to the location to be builtSourcingLocationBuilderwithDistance(java.lang.Double distance)SourcingLocationBuilderwithPriority(java.lang.Integer priority)SourcingLocationBuilderwithWarehouse(WarehouseModel warehouse)SourcingLocationBuilderwithWarehouseCode(java.lang.String id)Creates a newWarehouseModelfrom the given id
-
-
-
Field Detail
-
DEFAULT_DISTANCE
public static final java.lang.Double DEFAULT_DISTANCE
-
DEFAULT_PRIORITY
public static final java.lang.Integer DEFAULT_PRIORITY
-
DEFAULT_INITIAL_ID
public static final java.lang.Integer DEFAULT_INITIAL_ID
-
DEFAULT_SKU
public static final java.lang.String DEFAULT_SKU
- See Also:
- Constant Field Values
-
DEFAULT_SKU_QUANTITY
public static final java.lang.Long DEFAULT_SKU_QUANTITY
-
-
Method Detail
-
aSourcingLocation
public static SourcingLocationBuilder aSourcingLocation()
-
build
public SourcingLocation build()
Description copied from interface:BuilderBuilds an instance of type T (e.g., a SourcingLocation, a FitnessContext, ...)- Specified by:
buildin interfaceBuilder<SourcingLocation>- Returns:
- the instance
-
withWarehouse
public SourcingLocationBuilder withWarehouse(WarehouseModel warehouse)
-
withDistance
public SourcingLocationBuilder withDistance(java.lang.Double distance)
-
withContext
public SourcingLocationBuilder withContext(SourcingContext context)
-
withWarehouseCode
public SourcingLocationBuilder withWarehouseCode(java.lang.String id)
Creates a newWarehouseModelfrom the given id- Parameters:
id- - the String id of the warehouse to be created- Returns:
SourcingLocationBuilder
-
withAvailability
public SourcingLocationBuilder withAvailability(java.util.Map<ProductModel,java.lang.Long> availability)
-
withPriority
public SourcingLocationBuilder withPriority(java.lang.Integer priority)
-
withDefaultAvailabilityQuantity
public SourcingLocationBuilder withDefaultAvailabilityQuantity(java.lang.Long quantity)
Adds a new Product of the default SKU and the specified quantity to the location to be built- Parameters:
quantity- - the quantity of the the product- Returns:
- SourcingLocationBuilder
-
withCustomAvailabilitySkuQuantity
public SourcingLocationBuilder withCustomAvailabilitySkuQuantity(java.lang.String SKUId, java.lang.Long quantity)
Adds a newProductModelof the specified SKU and quantity to the location to be built- Parameters:
SKUId- - SKU ID to be used as the product codequantity- - the quantity of the the product- Returns:
- SourcingLocationBuilder
-
withCustomAvailabilityProductQuantity
public SourcingLocationBuilder withCustomAvailabilityProductQuantity(ProductModel productModel, java.lang.Long quantity)
Adds an existingProductModelof the specified quantity to the location to be built- Parameters:
productModel-quantity-- Returns:
-
-