Interface Variant
public interface Variant
Variant
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Variant variant = Variant.builder()
.id(1)
.sku("{sku}")
.key("{key}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic VariantBuilder
builder()
builder factory method for Variantstatic VariantBuilder
create builder for Variant instancestatic Variant
factory method to create a deep copy of Variant@NotNull Integer
getId()
@NotNull String
getKey()
@NotNull String
getSku()
static Variant
of()
factory methodstatic Variant
factory method to create a shallow copy Variantvoid
set idvoid
set keyvoid
set skustatic com.fasterxml.jackson.core.type.TypeReference<Variant>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withVariant
(Function<Variant, T> helper) accessor map function
-
Method Details
-
getId
- Returns:
- id
-
getSku
- Returns:
- sku
-
getKey
- Returns:
- key
-
setId
set id- Parameters:
id
- value to be set
-
setSku
set sku- Parameters:
sku
- value to be set
-
setKey
set key- Parameters:
key
- value to be set
-
of
factory method- Returns:
- instance of Variant
-
of
factory method to create a shallow copy Variant- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of Variant- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Variant- Returns:
- builder
-
builder
create builder for Variant instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withVariant
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
-