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 ProductVariantBuilderbuilder()builder factory method for ProductVariantstatic ProductVariantBuilderbuilder(ProductVariant template) create builder for ProductVariant instancestatic ProductVariantdeepCopy(ProductVariant template) factory method to create a deep copy of ProductVariant@NotNull @Valid ProductReferenceThe product that contains this variant.@NotNull BooleanThe state of the product variant.@NotNull IntegerThe id of the product variant.static ProductVariantof()factory methodstatic ProductVariantof(ProductVariant template) factory method to create a shallow copy ProductVariantvoidsetProduct(ProductReference product) The product that contains this variant.voidThe state of the product variant.voidsetVariantId(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> TwithProductVariant(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
-