Interface Category
- All Superinterfaces:
BaseResource,CategoryMixin,Customizable<Category>,DomainResource<Category>,Identifiable<Category>,Referencable<Category>,ResourceIdentifiable<Category>,Versioned<Category>,WithKey
Example to create an instance using the builder pattern
Category category = Category.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.name(nameBuilder -> nameBuilder)
.slug(slugBuilder -> slugBuilder)
.plusAncestors(ancestorsBuilder -> ancestorsBuilder)
.orderHint("{orderHint}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CategoryBuilderbuilder()builder factory method for Categorystatic CategoryBuildercreate builder for Category instancecopyDeep()static Categoryfactory method to create a deep copy of Category@NotNull @Valid List<CategoryReference>Contains the parent path towards the root Category.Media related to the Category.@NotNull ZonedDateTimeDate and time (UTC) the Category was initially created.@Valid CreatedByIDs and references that created the Category.@Valid CustomFieldsCustom Fields for the Category.@Valid LocalizedStringDescription of the Category.Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).@NotNull StringgetId()Unique identifier of the Category.getKey()User-defined unique identifier of the Category.@NotNull ZonedDateTimeDate and time (UTC) the Category was last updated.@Valid LastModifiedByIDs and references that last modified 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.@NotNull StringDecimal value between 0 and 1.@Valid CategoryReferenceParent Category of this Category.@NotNull @Valid LocalizedStringgetSlug()User-defined identifier used as a deep-link URL to the related Category per Locale.@NotNull LongCurrent version of the Category.static Categoryof()factory methodstatic Categoryfactory method to create a shallow copy Categorystatic ReferenceTypeIdvoidsetAncestors(CategoryReference... ancestors) Contains the parent path towards the root Category.voidsetAncestors(List<CategoryReference> ancestors) Contains the parent path towards the root Category.voidMedia related to the Category.voidMedia related to the Category.voidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Category was initially created.voidsetCreatedBy(CreatedBy createdBy) IDs and references that created the Category.voidsetCustom(CustomFields 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).voidUnique identifier of the Category.voidUser-defined unique identifier of the Category.voidsetLastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the Category was last updated.voidsetLastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified 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(CategoryReference parent) Parent Category of this Category.voidsetSlug(LocalizedString slug) User-defined identifier used as a deep-link URL to the related Category per Locale.voidsetVersion(Long version) Current version of the Category.static com.fasterxml.jackson.core.type.TypeReference<Category>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithCategory(Function<Category, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResourceMethods inherited from interface com.commercetools.api.models.category.CategoryMixin
toReference, toResourceIdentifierMethods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizableMethods inherited from interface com.commercetools.api.models.DomainResource
get
-
Method Details
-
getId
Unique identifier of the Category.
- Specified by:
getIdin interfaceBaseResource- Specified by:
getIdin interfaceDomainResource<Category>- Specified by:
getIdin interfaceIdentifiable<Category>- Specified by:
getIdin interfaceVersioned<Category>- Returns:
- id
-
getVersion
Current version of the Category.
- Specified by:
getVersionin interfaceBaseResource- Specified by:
getVersionin interfaceDomainResource<Category>- Specified by:
getVersionin interfaceVersioned<Category>- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Category was initially created.
- Specified by:
getCreatedAtin interfaceBaseResource- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Category was last updated.
- Specified by:
getLastModifiedAtin interfaceBaseResource- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the Category.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Category.
- Returns:
- createdBy
-
getName
Name of the Category.
- Returns:
- name
-
getSlug
User-defined identifier used as a deep-link URL to the related Category per Locale. A Category can have the same slug for different Locales, but they are unique across the Project. Valid slugs match the pattern
^[A-Za-z0-9_-]{2,256}+$. For good performance, indexes are provided for the first 15languagesset in a Project.- Returns:
- slug
-
getDescription
Description of the Category.
- Returns:
- description
-
getAncestors
Contains the parent path towards the root Category.
- Returns:
- ancestors
-
getParent
Parent Category of this Category.
- Returns:
- parent
-
getOrderHint
Decimal value between 0 and 1. Frontend applications can use this value for ordering Categories within the same level in the category tree.
- 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 interfaceCustomizable<Category>- Returns:
- custom
-
getAssets
Media related to the Category.
- Returns:
- assets
-
getKey
String getKey()User-defined unique identifier of the Category.
-
setId
Unique identifier of the Category.
- Specified by:
setIdin interfaceBaseResource- Parameters:
id- value to be set
-
setVersion
Current version of the Category.
- Specified by:
setVersionin interfaceBaseResource- Parameters:
version- value to be set
-
setCreatedAt
Date and time (UTC) the Category was initially created.
- Specified by:
setCreatedAtin interfaceBaseResource- Parameters:
createdAt- value to be set
-
setLastModifiedAt
Date and time (UTC) the Category was last updated.
- Specified by:
setLastModifiedAtin interfaceBaseResource- Parameters:
lastModifiedAt- value to be set
-
setLastModifiedBy
IDs and references that last modified the Category.
- Parameters:
lastModifiedBy- value to be set
-
setCreatedBy
IDs and references that created the Category.
- Parameters:
createdBy- value to be set
-
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 per Locale. A Category can have the same slug for different Locales, but they are unique across the Project. Valid slugs match the pattern
^[A-Za-z0-9_-]{2,256}+$. For good performance, indexes are provided for the first 15languagesset in a Project.- Parameters:
slug- value to be set
-
setDescription
Description of the Category.
- Parameters:
description- value to be set
-
setAncestors
Contains the parent path towards the root Category.
- Parameters:
ancestors- values to be set
-
setAncestors
Contains the parent path towards the root Category.
- Parameters:
ancestors- values to be set
-
setParent
Parent Category of this Category.
- 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.
- 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 interfaceCustomizable<Category>- 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 of the Category.
- Parameters:
key- value to be set
-
of
factory method- Returns:
- instance of Category
-
of
factory method to create a shallow copy Category- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
Category copyDeep()- Specified by:
copyDeepin interfaceBaseResource
-
deepCopy
factory method to create a deep copy of Category- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Category- Returns:
- builder
-
builder
create builder for Category instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withCategory
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
referenceTypeId
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-