Interface Attribute
public interface Attribute
Attribute
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Attribute attribute = Attribute.builder()
.name("{name}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic AttributeBuilder
builder()
builder factory method for Attributestatic AttributeBuilder
create builder for Attribute instancestatic Attribute
factory method to create a deep copy of Attribute@NotNull String
getName()
Name of the Attribute.@NotNull Object
getValue()
The AttributeType determines the format of the Attributevalue
to be provided:static Attribute
of()
factory methodstatic Attribute
factory method to create a shallow copy Attributevoid
Name of the Attribute.void
The AttributeType determines the format of the Attributevalue
to be provided:static 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
Name of the Attribute.
- Returns:
- name
-
getValue
The AttributeType determines the format of the Attribute
value
to be provided:- For Enum Type and Localized Enum Type, use the
key
of the Plain Enum Value or Localized Enum Value objects, or the complete objects asvalue
. - For Localizable Text Type, use the LocalizedString object as
value
. - For Money Type Attributes, use the Money object as
value
. - For Set Type Attributes, use the entire
set
object asvalue
. - For Nested Type Attributes, use the list of values of all Attributes of the nested Product as
value
. - For Reference Type Attributes, use the Reference object as
value
.
- Returns:
- value
- For Enum Type and Localized Enum Type, use the
-
setName
Name of the Attribute.
- Parameters:
name
- value to be set
-
setValue
The AttributeType determines the format of the Attribute
value
to be provided:- For Enum Type and Localized Enum Type, use the
key
of the Plain Enum Value or Localized Enum Value objects, or the complete objects asvalue
. - For Localizable Text Type, use the LocalizedString object as
value
. - For Money Type Attributes, use the Money object as
value
. - For Set Type Attributes, use the entire
set
object asvalue
. - For Nested Type Attributes, use the list of values of all Attributes of the nested Product as
value
. - For Reference Type Attributes, use the Reference object as
value
.
- Parameters:
value
- value to be set
- For Enum Type and Localized Enum Type, use the
-
of
factory method- Returns:
- instance of Attribute
-
of
factory method to create a shallow copy Attribute- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of Attribute- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Attribute- Returns:
- builder
-
builder
create builder for Attribute instance- Parameters:
template
- instance with prefilled values for the builder- 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
-