Interface ProductVariant
public interface ProductVariant
The product variant that contains the image.
Example to create an instance using the builder pattern
ProductVariant productVariant = ProductVariant.builder()
.product(productBuilder -> productBuilder)
.staged(true)
.variantId(0.3)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductVariantBuilder
builder()
builder factory method for ProductVariantstatic ProductVariantBuilder
builder
(ProductVariant template) create builder for ProductVariant instancestatic ProductVariant
deepCopy
(ProductVariant template) factory method to create a deep copy of ProductVariant@NotNull @Valid ProductReference
The product that contains this variant.@NotNull Boolean
The state of the product variant.@NotNull Integer
The id of the product variant.static ProductVariant
of()
factory methodstatic ProductVariant
of
(ProductVariant template) factory method to create a shallow copy ProductVariantvoid
setProduct
(ProductReference product) The product that contains this variant.void
The state of the product variant.void
setVariantId
(Integer variantId) The id of the product variant.static com.fasterxml.jackson.core.type.TypeReference<ProductVariant>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withProductVariant
(Function<ProductVariant, T> helper) accessor map function
-
Method Details
-
getProduct
The product that contains this variant.
- Returns:
- product
-
getStaged
The state of the product variant.
- Returns:
- staged
-
getVariantId
The id of the product variant.
- Returns:
- variantId
-
setProduct
The product that contains this variant.
- Parameters:
product
- value to be set
-
setStaged
The state of the product variant.
- Parameters:
staged
- value to be set
-
setVariantId
The id of the product variant.
- Parameters:
variantId
- value to be set
-
of
factory method- Returns:
- instance of ProductVariant
-
of
factory method to create a shallow copy ProductVariant- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ProductVariant- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductVariant- Returns:
- builder
-
builder
create builder for ProductVariant instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductVariant
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-