Class CategoryDraftBuilder
- All Implemented Interfaces:
Builder<CategoryDraft>
Example to create an instance using the builder pattern
CategoryDraft categoryDraft = CategoryDraft.builder()
.name(nameBuilder -> nameBuilder)
.slug(slugBuilder -> slugBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAssets(Function<AssetDraftBuilder, AssetDraft> builder) Media related to the Category.Stores to assign the Category to.assets(AssetDraft... assets) Media related to the Category.assets(List<AssetDraft> assets) Media related to the Category.build()builds CategoryDraft with checking for non-null required valuesbuilds CategoryDraft without checking for non-null required valuescustom(CustomFieldsDraft custom) Custom Fields for the Category.Custom Fields for the Category.description(LocalizedString description) Description of the Category.Description of the Category.externalId(String externalId) Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).Media related to the Category.Custom Fields for the Category.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.Description of the Category used by external search engines for improved search engine performance.Keywords related to the Category for improved search engine performance.Name of the Category used by external search engines for improved search engine performance.getName()Name of the Category.A decimal value between 0 and 1 used to order Categories within the same level of the category tree.Parent Category of the Category.getSlug()User-defined identifier used as a deep-link URL to the related Category.Stores to assign the Category to.User-defined unique identifier for the Category.metaDescription(LocalizedString metaDescription) Description of the Category used by external search engines for improved search engine performance.Description of the Category used by external search engines for improved search engine performance.metaKeywords(LocalizedString metaKeywords) Keywords related to the Category for improved search engine performance.Keywords related to the Category for improved search engine performance.metaTitle(LocalizedString metaTitle) Name of the Category used by external search engines for improved search engine performance.Name of the Category used by external search engines for improved search engine performance.name(LocalizedString name) Name of the Category.Name of the Category.static CategoryDraftBuilderof()factory method for an instance of CategoryDraftBuilderstatic CategoryDraftBuilderof(CategoryDraft template) create builder for CategoryDraft instanceA decimal value between 0 and 1 used to order Categories within the same level of the category tree.parent(CategoryResourceIdentifier parent) Parent Category of the Category.Parent Category of the Category.plusAssets(AssetDraft... assets) Media related to the Category.plusAssets(Function<AssetDraftBuilder, AssetDraftBuilder> builder) Media related to the Category.plusStores(StoreResourceIdentifier... stores) Stores to assign the Category to.Stores to assign the Category to.setAssets(Function<AssetDraftBuilder, AssetDraft> builder) Media related to the Category.Stores to assign the Category to.slug(LocalizedString slug) User-defined identifier used as a deep-link URL to the related Category.User-defined identifier used as a deep-link URL to the related Category.stores(StoreResourceIdentifier... stores) Stores to assign the Category to.stores(List<StoreResourceIdentifier> stores) Stores to assign the Category to.withAssets(Function<AssetDraftBuilder, AssetDraftBuilder> builder) Media related to the Category.Custom Fields for the Category.Description of the Category.Description of the Category used by external search engines for improved search engine performance.Keywords related to the Category for improved search engine performance.Name of the Category used by external search engines for improved search engine performance.Name of the Category.Parent Category of the Category.User-defined identifier used as a deep-link URL to the related Category.Stores to assign the Category to.
-
Constructor Details
-
CategoryDraftBuilder
public CategoryDraftBuilder()
-
-
Method Details
-
name
Name of the Category.
- Parameters:
builder- function to build the name value- Returns:
- Builder
-
withName
Name of the Category.
- Parameters:
builder- function to build the name value- Returns:
- Builder
-
name
Name of the Category.
- Parameters:
name- value to be set- Returns:
- Builder
-
slug
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:
builder- function to build the slug value- Returns:
- Builder
-
withSlug
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:
builder- function to build the slug value- Returns:
- Builder
-
slug
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- Returns:
- Builder
-
description
public CategoryDraftBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the Category.
- Parameters:
builder- function to build the description value- Returns:
- Builder
-
withDescription
public CategoryDraftBuilder withDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Description of the Category.
- Parameters:
builder- function to build the description value- Returns:
- Builder
-
description
Description of the Category.
- Parameters:
description- value to be set- Returns:
- Builder
-
parent
public CategoryDraftBuilder parent(Function<CategoryResourceIdentifierBuilder, CategoryResourceIdentifierBuilder> builder) Parent Category of the Category. The parent can be set by its
idorkey.- Parameters:
builder- function to build the parent value- Returns:
- Builder
-
withParent
public CategoryDraftBuilder withParent(Function<CategoryResourceIdentifierBuilder, CategoryResourceIdentifier> builder) Parent Category of the Category. The parent can be set by its
idorkey.- Parameters:
builder- function to build the parent value- Returns:
- Builder
-
parent
Parent Category of the Category. The parent can be set by its
idorkey.- Parameters:
parent- value to be set- Returns:
- Builder
-
orderHint
A decimal value between 0 and 1 used to order Categories within the same level of the category tree. When sorted in ascending order, Categories with a lower
orderHintappear before those with a higher value (for example,0.05before0.07). If not set, a random value is assigned.- Parameters:
orderHint- value to be set- Returns:
- Builder
-
externalId
Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).
- Parameters:
externalId- value to be set- Returns:
- Builder
-
metaTitle
public CategoryDraftBuilder metaTitle(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Name of the Category used by external search engines for improved search engine performance.
- Parameters:
builder- function to build the metaTitle value- Returns:
- Builder
-
withMetaTitle
Name of the Category used by external search engines for improved search engine performance.
- Parameters:
builder- function to build the metaTitle value- Returns:
- Builder
-
metaTitle
Name of the Category used by external search engines for improved search engine performance.
- Parameters:
metaTitle- value to be set- Returns:
- Builder
-
metaDescription
public CategoryDraftBuilder metaDescription(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the Category used by external search engines for improved search engine performance.
- Parameters:
builder- function to build the metaDescription value- Returns:
- Builder
-
withMetaDescription
public CategoryDraftBuilder withMetaDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Description of the Category used by external search engines for improved search engine performance.
- Parameters:
builder- function to build the metaDescription value- Returns:
- Builder
-
metaDescription
Description of the Category used by external search engines for improved search engine performance.
- Parameters:
metaDescription- value to be set- Returns:
- Builder
-
metaKeywords
public CategoryDraftBuilder metaKeywords(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Keywords related to the Category for improved search engine performance.
- Parameters:
builder- function to build the metaKeywords value- Returns:
- Builder
-
withMetaKeywords
public CategoryDraftBuilder withMetaKeywords(Function<LocalizedStringBuilder, LocalizedString> builder) Keywords related to the Category for improved search engine performance.
- Parameters:
builder- function to build the metaKeywords value- Returns:
- Builder
-
metaKeywords
Keywords related to the Category for improved search engine performance.
- Parameters:
metaKeywords- value to be set- Returns:
- Builder
-
custom
public CategoryDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Category.
- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
withCustom
public CategoryDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for the Category.
- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Category.
- Parameters:
custom- value to be set- Returns:
- Builder
-
assets
Media related to the Category.
- Parameters:
assets- value to be set- Returns:
- Builder
-
assets
Media related to the Category.
- Parameters:
assets- value to be set- Returns:
- Builder
-
plusAssets
Media related to the Category.
- Parameters:
assets- value to be set- Returns:
- Builder
-
plusAssets
Media related to the Category.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
withAssets
Media related to the Category.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
addAssets
Media related to the Category.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
setAssets
Media related to the Category.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
key
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- Returns:
- Builder
-
stores
Stores to assign the Category to.
If not defined or set to an empty array, the Category is global.
If defined, you must have access to each referenced Store; otherwise, an InvalidInput error is returned.
If the Category has a parent category, and the parent is assigned to Stores, this value must be a non-empty subset of the parent's Stores.
- Parameters:
stores- value to be set- Returns:
- Builder
-
stores
Stores to assign the Category to.
If not defined or set to an empty array, the Category is global.
If defined, you must have access to each referenced Store; otherwise, an InvalidInput error is returned.
If the Category has a parent category, and the parent is assigned to Stores, this value must be a non-empty subset of the parent's Stores.
- Parameters:
stores- value to be set- Returns:
- Builder
-
plusStores
Stores to assign the Category to.
If not defined or set to an empty array, the Category is global.
If defined, you must have access to each referenced Store; otherwise, an InvalidInput error is returned.
If the Category has a parent category, and the parent is assigned to Stores, this value must be a non-empty subset of the parent's Stores.
- Parameters:
stores- value to be set- Returns:
- Builder
-
plusStores
public CategoryDraftBuilder plusStores(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifierBuilder> builder) Stores to assign the Category to.
If not defined or set to an empty array, the Category is global.
If defined, you must have access to each referenced Store; otherwise, an InvalidInput error is returned.
If the Category has a parent category, and the parent is assigned to Stores, this value must be a non-empty subset of the parent's Stores.
- Parameters:
builder- function to build the stores value- Returns:
- Builder
-
withStores
public CategoryDraftBuilder withStores(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifierBuilder> builder) Stores to assign the Category to.
If not defined or set to an empty array, the Category is global.
If defined, you must have access to each referenced Store; otherwise, an InvalidInput error is returned.
If the Category has a parent category, and the parent is assigned to Stores, this value must be a non-empty subset of the parent's Stores.
- Parameters:
builder- function to build the stores value- Returns:
- Builder
-
addStores
public CategoryDraftBuilder addStores(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifier> builder) Stores to assign the Category to.
If not defined or set to an empty array, the Category is global.
If defined, you must have access to each referenced Store; otherwise, an InvalidInput error is returned.
If the Category has a parent category, and the parent is assigned to Stores, this value must be a non-empty subset of the parent's Stores.
- Parameters:
builder- function to build the stores value- Returns:
- Builder
-
setStores
public CategoryDraftBuilder setStores(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifier> builder) Stores to assign the Category to.
If not defined or set to an empty array, the Category is global.
If defined, you must have access to each referenced Store; otherwise, an InvalidInput error is returned.
If the Category has a parent category, and the parent is assigned to Stores, this value must be a non-empty subset of the parent's Stores.
- Parameters:
builder- function to build the stores value- Returns:
- Builder
-
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
A decimal value between 0 and 1 used to order Categories within the same level of the category tree. When sorted in ascending order, Categories with a lower
orderHintappear before those with a higher value (for example,0.05before0.07). If not set, a random value is assigned.- Returns:
- orderHint
-
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.
- Returns:
- custom
-
getAssets
Media related to the Category.
- Returns:
- assets
-
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.
- Returns:
- key
-
getStores
Stores to assign the Category to.
If not defined or set to an empty array, the Category is global.
If defined, you must have access to each referenced Store; otherwise, an InvalidInput error is returned.
If the Category has a parent category, and the parent is assigned to Stores, this value must be a non-empty subset of the parent's Stores.
- Returns:
- stores
-
build
builds CategoryDraft with checking for non-null required values- Specified by:
buildin interfaceBuilder<CategoryDraft>- Returns:
- CategoryDraft
-
buildUnchecked
builds CategoryDraft without checking for non-null required values- Returns:
- CategoryDraft
-
of
factory method for an instance of CategoryDraftBuilder- Returns:
- builder
-
of
create builder for CategoryDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-