Interface CategoryDraft
- All Superinterfaces:
CustomizableDraft<CategoryDraft>
,Draft<CategoryDraft>
,WithKey
Example to create an instance using the builder pattern
CategoryDraft categoryDraft = CategoryDraft.builder()
.name(nameBuilder -> nameBuilder)
.slug(slugBuilder -> slugBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CategoryDraftBuilder
builder()
builder factory method for CategoryDraftstatic CategoryDraftBuilder
builder
(CategoryDraft template) create builder for CategoryDraft instancestatic CategoryDraft
deepCopy
(CategoryDraft template) factory method to create a deep copy of CategoryDraft@Valid List<AssetDraft>
Media related to the Category.@Valid CustomFieldsDraft
Custom Fields for the Category.@Valid LocalizedString
Description of the Category.Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).getKey()
User-defined unique identifier for the Category.@Valid LocalizedString
Description of the Category used by external search engines for improved search engine performance.@Valid LocalizedString
Keywords related to the Category for improved search engine performance.@Valid LocalizedString
Name of the Category used by external search engines for improved search engine performance.@NotNull @Valid LocalizedString
getName()
Name of the Category.Decimal value between 0 and 1.@Valid CategoryResourceIdentifier
Parent Category of the Category.@NotNull @Valid LocalizedString
getSlug()
User-defined identifier used as a deep-link URL to the related Category.static CategoryDraft
of()
factory methodstatic CategoryDraft
of
(CategoryDraft template) factory method to create a shallow copy CategoryDraftvoid
setAssets
(AssetDraft... assets) Media related to the Category.void
setAssets
(List<AssetDraft> assets) Media related to the Category.void
setCustom
(CustomFieldsDraft custom) Custom Fields for the Category.void
setDescription
(LocalizedString description) Description of the Category.void
setExternalId
(String externalId) Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).void
User-defined unique identifier for the Category.void
setMetaDescription
(LocalizedString metaDescription) Description of the Category used by external search engines for improved search engine performance.void
setMetaKeywords
(LocalizedString metaKeywords) Keywords related to the Category for improved search engine performance.void
setMetaTitle
(LocalizedString metaTitle) Name of the Category used by external search engines for improved search engine performance.void
setName
(LocalizedString name) Name of the Category.void
setOrderHint
(String orderHint) Decimal value between 0 and 1.void
setParent
(CategoryResourceIdentifier parent) Parent Category of the Category.void
setSlug
(LocalizedString slug) User-defined identifier used as a deep-link URL to the related Category.static com.fasterxml.jackson.core.type.TypeReference<CategoryDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withCategoryDraft
(Function<CategoryDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getName
Name of the Category.
- Returns:
- name
-
getSlug
User-defined identifier used as a deep-link URL to the related Category. A Category can have the same slug for different Locales, but it must be unique across the Project. Valid slugs must match the pattern
^[A-Za-z0-9_-]{2,256}+$
.- Returns:
- slug
-
getDescription
Description of the Category.
- Returns:
- description
-
getParent
Parent Category of the Category. The parent can be set by its
id
orkey
.- Returns:
- parent
-
getOrderHint
String getOrderHint()Decimal value between 0 and 1. Frontend applications can use this value for ordering Categories within the same level in the category tree. If not set, a random value will be assigned.
- Returns:
- orderHint
-
getExternalId
String getExternalId()Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).
- Returns:
- externalId
-
getMetaTitle
Name of the Category used by external search engines for improved search engine performance.
- Returns:
- metaTitle
-
getMetaDescription
Description of the Category used by external search engines for improved search engine performance.
- Returns:
- metaDescription
-
getMetaKeywords
Keywords related to the Category for improved search engine performance.
- Returns:
- metaKeywords
-
getCustom
Custom Fields for the Category.
- Specified by:
getCustom
in interfaceCustomizableDraft<CategoryDraft>
- Returns:
- custom
-
getAssets
Media related to the Category.
- Returns:
- assets
-
getKey
String getKey()User-defined unique identifier for the Category.
This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing Categories with the Import API and the Merchant Center.
-
setName
Name of the Category.
- Parameters:
name
- value to be set
-
setSlug
User-defined identifier used as a deep-link URL to the related Category. A Category can have the same slug for different Locales, but it must be unique across the Project. Valid slugs must match the pattern
^[A-Za-z0-9_-]{2,256}+$
.- Parameters:
slug
- value to be set
-
setDescription
Description of the Category.
- Parameters:
description
- value to be set
-
setParent
Parent Category of the Category. The parent can be set by its
id
orkey
.- Parameters:
parent
- value to be set
-
setOrderHint
Decimal value between 0 and 1. Frontend applications can use this value for ordering Categories within the same level in the category tree. If not set, a random value will be assigned.
- Parameters:
orderHint
- value to be set
-
setExternalId
Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).
- Parameters:
externalId
- value to be set
-
setMetaTitle
Name of the Category used by external search engines for improved search engine performance.
- Parameters:
metaTitle
- value to be set
-
setMetaDescription
Description of the Category used by external search engines for improved search engine performance.
- Parameters:
metaDescription
- value to be set
-
setMetaKeywords
Keywords related to the Category for improved search engine performance.
- Parameters:
metaKeywords
- value to be set
-
setCustom
Custom Fields for the Category.
- Specified by:
setCustom
in interfaceCustomizableDraft<CategoryDraft>
- Parameters:
custom
- value to be set
-
setAssets
Media related to the Category.
- Parameters:
assets
- values to be set
-
setAssets
Media related to the Category.
- Parameters:
assets
- values to be set
-
setKey
User-defined unique identifier for the Category.
This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing Categories with the Import API and the Merchant Center.
- Parameters:
key
- value to be set
-
of
factory method- Returns:
- instance of CategoryDraft
-
of
factory method to create a shallow copy CategoryDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of CategoryDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CategoryDraft- Returns:
- builder
-
builder
create builder for CategoryDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withCategoryDraft
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
-