Class ProductVariantAvailabilityBuilder
java.lang.Object
com.commercetools.history.models.common.ProductVariantAvailabilityBuilder
- All Implemented Interfaces:
Builder<ProductVariantAvailability>
public class ProductVariantAvailabilityBuilder
extends Object
implements Builder<ProductVariantAvailability>
ProductVariantAvailabilityBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ProductVariantAvailability productVariantAvailability = ProductVariantAvailability.builder()
.isOnStock(true)
.restockableInDays(1)
.availableQuantity(1)
.channels(channelsBuilder -> channelsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionavailableQuantity
(Integer availableQuantity) set the value to the availableQuantitybuild()
builds ProductVariantAvailability with checking for non-null required valuesbuilds ProductVariantAvailability without checking for non-null required valueschannels
(ProductVariantChannelAvailabilityMap channels) set the value to the channelschannels
(Function<ProductVariantChannelAvailabilityMapBuilder, ProductVariantChannelAvailabilityMapBuilder> builder) set the value to the channels using the builder functionvalue of availableQuantity}value of channels}value of isOnStock}value of restockableInDays}set the value to the isOnStockof()
factory method for an instance of ProductVariantAvailabilityBuilderof
(ProductVariantAvailability template) create builder for ProductVariantAvailability instancerestockableInDays
(Integer restockableInDays) set the value to the restockableInDayswithChannels
(Function<ProductVariantChannelAvailabilityMapBuilder, ProductVariantChannelAvailabilityMap> builder) set the value to the channels using the builder function
-
Constructor Details
-
ProductVariantAvailabilityBuilder
public ProductVariantAvailabilityBuilder()
-
-
Method Details
-
isOnStock
set the value to the isOnStock- Parameters:
isOnStock
- value to be set- Returns:
- Builder
-
restockableInDays
set the value to the restockableInDays- Parameters:
restockableInDays
- value to be set- Returns:
- Builder
-
availableQuantity
set the value to the availableQuantity- Parameters:
availableQuantity
- value to be set- Returns:
- Builder
-
channels
public ProductVariantAvailabilityBuilder channels(Function<ProductVariantChannelAvailabilityMapBuilder, ProductVariantChannelAvailabilityMapBuilder> builder) set the value to the channels using the builder function- Parameters:
builder
- function to build the channels value- Returns:
- Builder
-
withChannels
public ProductVariantAvailabilityBuilder withChannels(Function<ProductVariantChannelAvailabilityMapBuilder, ProductVariantChannelAvailabilityMap> builder) set the value to the channels using the builder function- Parameters:
builder
- function to build the channels value- Returns:
- Builder
-
channels
set the value to the channels- Parameters:
channels
- value to be set- Returns:
- Builder
-
getIsOnStock
value of isOnStock}- Returns:
- isOnStock
-
getRestockableInDays
value of restockableInDays}- Returns:
- restockableInDays
-
getAvailableQuantity
value of availableQuantity}- Returns:
- availableQuantity
-
getChannels
value of channels}- Returns:
- channels
-
build
builds ProductVariantAvailability with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductVariantAvailability>
- Returns:
- ProductVariantAvailability
-
buildUnchecked
builds ProductVariantAvailability without checking for non-null required values- Returns:
- ProductVariantAvailability
-
of
factory method for an instance of ProductVariantAvailabilityBuilder- Returns:
- builder
-
of
create builder for ProductVariantAvailability instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-