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 CategoryBuilder
builder()
builder factory method for Categorystatic CategoryBuilder
create builder for Category instancestatic Category
factory 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 ZonedDateTime
Date and time (UTC) the Category was initially created.@Valid CreatedBy
IDs and references that created the Category.@Valid CustomFields
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).@NotNull String
getId()
Unique identifier of the Category.getKey()
User-defined unique identifier of the Category.@NotNull ZonedDateTime
Date and time (UTC) the Category was last updated.@Valid LastModifiedBy
IDs and references that last modified 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.@NotNull String
Decimal value between 0 and 1.@Valid CategoryReference
Parent Category of this Category.@NotNull @Valid LocalizedString
getSlug()
User-defined identifier used as a deep-link URL to the related Category per Locale.@NotNull Long
Current version of the Category.static Category
of()
factory methodstatic Category
factory method to create a shallow copy Categorystatic ReferenceTypeId
void
setAncestors
(CategoryReference... ancestors) Contains the parent path towards the root Category.void
setAncestors
(List<CategoryReference> ancestors) Contains the parent path towards the root Category.void
Media related to the Category.void
Media related to the Category.void
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Category was initially created.void
setCreatedBy
(CreatedBy createdBy) IDs and references that created the Category.void
setCustom
(CustomFields 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
Unique identifier of the Category.void
User-defined unique identifier of the Category.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Category was last updated.void
setLastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified 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
(CategoryReference parent) Parent Category of this Category.void
setSlug
(LocalizedString slug) User-defined identifier used as a deep-link URL to the related Category per Locale.void
setVersion
(Long version) Current version of the Category.static com.fasterxml.jackson.core.type.TypeReference<Category>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withCategory
(Function<Category, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
Methods inherited from interface com.commercetools.api.models.category.CategoryMixin
toReference, toResourceIdentifier
Methods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizable
Methods inherited from interface com.commercetools.api.models.DomainResource
get
-
Method Details
-
getId
Unique identifier of the Category.
- Specified by:
getId
in interfaceBaseResource
- Specified by:
getId
in interfaceDomainResource<Category>
- Specified by:
getId
in interfaceIdentifiable<Category>
- Specified by:
getId
in interfaceVersioned<Category>
- Returns:
- id
-
getVersion
Current version of the Category.
- Specified by:
getVersion
in interfaceBaseResource
- Specified by:
getVersion
in interfaceDomainResource<Category>
- Specified by:
getVersion
in interfaceVersioned<Category>
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Category was initially created.
- Specified by:
getCreatedAt
in interfaceBaseResource
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Category was last updated.
- Specified by:
getLastModifiedAt
in 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 15languages
set 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:
getCustom
in 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:
setId
in interfaceBaseResource
- Parameters:
id
- value to be set
-
setVersion
Current version of the Category.
- Specified by:
setVersion
in interfaceBaseResource
- Parameters:
version
- value to be set
-
setCreatedAt
Date and time (UTC) the Category was initially created.
- Specified by:
setCreatedAt
in interfaceBaseResource
- Parameters:
createdAt
- value to be set
-
setLastModifiedAt
Date and time (UTC) the Category was last updated.
- Specified by:
setLastModifiedAt
in 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 15languages
set 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:
setCustom
in 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
-
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
-