Interface Attribute
- All Known Subinterfaces:
BooleanAttribute
,BooleanSetAttribute
,DateAttribute
,DateSetAttribute
,DateTimeAttribute
,DateTimeSetAttribute
,EnumAttribute
,EnumSetAttribute
,LocalizableEnumAttribute
,LocalizableEnumSetAttribute
,LocalizableTextAttribute
,LocalizableTextSetAttribute
,MoneyAttribute
,MoneySetAttribute
,NumberAttribute
,NumberSetAttribute
,ReferenceAttribute
,ReferenceSetAttribute
,TextAttribute
,TextSetAttribute
,TimeAttribute
,TimeSetAttribute
public interface Attribute
This type represents the value of an attribute of a product variant. The name and type property must match the name and type property of an attribute definition of the product type.
Example to create a subtype instance using the builder pattern
Attribute attribute = Attribute.booleanBuilder()
value(true)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic BooleanAttributeBuilder
builder for boolean subtypestatic BooleanSetAttributeBuilder
builder for booleanSet subtypestatic DateAttributeBuilder
builder for date subtypestatic DateSetAttributeBuilder
builder for dateSet subtypestatic DateTimeAttributeBuilder
builder for datetime subtypestatic DateTimeSetAttributeBuilder
builder for datetimeSet subtypestatic Attribute
factory method to create a deep copy of Attributestatic EnumAttributeBuilder
builder for enum subtypestatic EnumSetAttributeBuilder
builder for enumSet subtypegetName()
The name of this attribute must match a name of the product types attribute definitions.@NotNull String
getType()
builder for lenum subtypebuilder for lenumSet subtypebuilder for ltext subtypebuilder for ltextSet subtypestatic MoneyAttributeBuilder
builder for money subtypestatic MoneySetAttributeBuilder
builder for moneySet subtypestatic NumberAttributeBuilder
builder for number subtypestatic NumberSetAttributeBuilder
builder for numberSet subtypestatic ReferenceAttributeBuilder
builder for reference subtypestatic ReferenceSetAttributeBuilder
builder for referenceSet subtypevoid
The name of this attribute must match a name of the product types attribute definitions.static TextAttributeBuilder
builder for text subtypestatic TextSetAttributeBuilder
builder for textSet subtypestatic TimeAttributeBuilder
builder for time subtypestatic TimeSetAttributeBuilder
builder for timeSet subtypestatic com.fasterxml.jackson.core.type.TypeReference<Attribute>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withAttribute
(Function<Attribute, T> helper) accessor map function
-
Method Details
-
getName
String getName()The name of this attribute must match a name of the product types attribute definitions. The name is required if this type is used in a product variant and must not be set when used in a product variant patch.
- Returns:
- name
-
getType
- Returns:
- type
-
setName
The name of this attribute must match a name of the product types attribute definitions. The name is required if this type is used in a product variant and must not be set when used in a product variant patch.
- Parameters:
name
- value to be set
-
deepCopy
factory method to create a deep copy of Attribute- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
booleanBuilder
builder for boolean subtype- Returns:
- builder
-
booleanSetBuilder
builder for booleanSet subtype- Returns:
- builder
-
dateBuilder
builder for date subtype- Returns:
- builder
-
dateSetBuilder
builder for dateSet subtype- Returns:
- builder
-
datetimeBuilder
builder for datetime subtype- Returns:
- builder
-
datetimeSetBuilder
builder for datetimeSet subtype- Returns:
- builder
-
enumBuilder
builder for enum subtype- Returns:
- builder
-
enumSetBuilder
builder for enumSet subtype- Returns:
- builder
-
lenumBuilder
builder for lenum subtype- Returns:
- builder
-
lenumSetBuilder
builder for lenumSet subtype- Returns:
- builder
-
ltextBuilder
builder for ltext subtype- Returns:
- builder
-
ltextSetBuilder
builder for ltextSet subtype- Returns:
- builder
-
moneyBuilder
builder for money subtype- Returns:
- builder
-
moneySetBuilder
builder for moneySet subtype- Returns:
- builder
-
numberBuilder
builder for number subtype- Returns:
- builder
-
numberSetBuilder
builder for numberSet subtype- Returns:
- builder
-
referenceBuilder
builder for reference subtype- Returns:
- builder
-
referenceSetBuilder
builder for referenceSet subtype- Returns:
- builder
-
textBuilder
builder for text subtype- Returns:
- builder
-
textSetBuilder
builder for textSet subtype- Returns:
- builder
-
timeBuilder
builder for time subtype- Returns:
- builder
-
timeSetBuilder
builder for timeSet subtype- Returns:
- builder
-
withAttribute
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
-