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 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

      @NotNull @NotNull String getType()
      Returns:
      type
    • setName

      void setName(String name)

      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

      @Nullable static Attribute deepCopy(@Nullable Attribute template)
      factory method to create a deep copy of Attribute
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • booleanBuilder

      static BooleanAttributeBuilder booleanBuilder()
      builder for boolean subtype
      Returns:
      builder
    • booleanSetBuilder

      static BooleanSetAttributeBuilder booleanSetBuilder()
      builder for booleanSet subtype
      Returns:
      builder
    • dateBuilder

      static DateAttributeBuilder dateBuilder()
      builder for date subtype
      Returns:
      builder
    • dateSetBuilder

      static DateSetAttributeBuilder dateSetBuilder()
      builder for dateSet subtype
      Returns:
      builder
    • datetimeBuilder

      static DateTimeAttributeBuilder datetimeBuilder()
      builder for datetime subtype
      Returns:
      builder
    • datetimeSetBuilder

      static DateTimeSetAttributeBuilder datetimeSetBuilder()
      builder for datetimeSet subtype
      Returns:
      builder
    • enumBuilder

      static EnumAttributeBuilder enumBuilder()
      builder for enum subtype
      Returns:
      builder
    • enumSetBuilder

      static EnumSetAttributeBuilder enumSetBuilder()
      builder for enumSet subtype
      Returns:
      builder
    • lenumBuilder

      static LocalizableEnumAttributeBuilder lenumBuilder()
      builder for lenum subtype
      Returns:
      builder
    • lenumSetBuilder

      static LocalizableEnumSetAttributeBuilder lenumSetBuilder()
      builder for lenumSet subtype
      Returns:
      builder
    • ltextBuilder

      static LocalizableTextAttributeBuilder ltextBuilder()
      builder for ltext subtype
      Returns:
      builder
    • ltextSetBuilder

      static LocalizableTextSetAttributeBuilder ltextSetBuilder()
      builder for ltextSet subtype
      Returns:
      builder
    • moneyBuilder

      static MoneyAttributeBuilder moneyBuilder()
      builder for money subtype
      Returns:
      builder
    • moneySetBuilder

      static MoneySetAttributeBuilder moneySetBuilder()
      builder for moneySet subtype
      Returns:
      builder
    • numberBuilder

      static NumberAttributeBuilder numberBuilder()
      builder for number subtype
      Returns:
      builder
    • numberSetBuilder

      static NumberSetAttributeBuilder numberSetBuilder()
      builder for numberSet subtype
      Returns:
      builder
    • referenceBuilder

      static ReferenceAttributeBuilder referenceBuilder()
      builder for reference subtype
      Returns:
      builder
    • referenceSetBuilder

      static ReferenceSetAttributeBuilder referenceSetBuilder()
      builder for referenceSet subtype
      Returns:
      builder
    • textBuilder

      static TextAttributeBuilder textBuilder()
      builder for text subtype
      Returns:
      builder
    • textSetBuilder

      static TextSetAttributeBuilder textSetBuilder()
      builder for textSet subtype
      Returns:
      builder
    • timeBuilder

      static TimeAttributeBuilder timeBuilder()
      builder for time subtype
      Returns:
      builder
    • timeSetBuilder

      static TimeSetAttributeBuilder timeSetBuilder()
      builder for timeSet subtype
      Returns:
      builder
    • withAttribute

      default <T> T withAttribute(Function<Attribute,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<Attribute> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference