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 CategoryDraftBuilderbuilder()builder factory method for CategoryDraftstatic CategoryDraftBuilderbuilder(CategoryDraft template) create builder for CategoryDraft instancecopyDeep()static CategoryDraftdeepCopy(CategoryDraft template) factory method to create a deep copy of CategoryDraft@Valid List<AssetDraft>Media related to the Category.@Valid CustomFieldsDraftCustom Fields for the Category.@Valid LocalizedStringDescription 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 LocalizedStringDescription of the Category used by external search engines for improved search engine performance.@Valid LocalizedStringKeywords related to the Category for improved search engine performance.@Valid LocalizedStringName of the Category used by external search engines for improved search engine performance.@NotNull @Valid LocalizedStringgetName()Name of the Category.Decimal value between 0 and 1.@Valid CategoryResourceIdentifierParent Category of the Category.@NotNull @Valid LocalizedStringgetSlug()User-defined identifier used as a deep-link URL to the related Category.static CategoryDraftof()factory methodstatic CategoryDraftof(CategoryDraft template) factory method to create a shallow copy CategoryDraftvoidsetAssets(AssetDraft... assets) Media related to the Category.voidsetAssets(List<AssetDraft> assets) Media related to the Category.voidsetCustom(CustomFieldsDraft custom) Custom Fields for the Category.voidsetDescription(LocalizedString description) Description of the Category.voidsetExternalId(String externalId) Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).voidUser-defined unique identifier for the Category.voidsetMetaDescription(LocalizedString metaDescription) Description of the Category used by external search engines for improved search engine performance.voidsetMetaKeywords(LocalizedString metaKeywords) Keywords related to the Category for improved search engine performance.voidsetMetaTitle(LocalizedString metaTitle) Name of the Category used by external search engines for improved search engine performance.voidsetName(LocalizedString name) Name of the Category.voidsetOrderHint(String orderHint) Decimal value between 0 and 1.voidsetParent(CategoryResourceIdentifier parent) Parent Category of the Category.voidsetSlug(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> TwithCategoryDraft(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
idorkey.- 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:
getCustomin 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
idorkey.- 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:
setCustomin 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
-
copyDeep
CategoryDraft copyDeep() -
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
-