Interface Category

All Superinterfaces:
BaseResource, CategoryMixin, Customizable<Category>, DomainResource<Category>, Identifiable<Category>, Referencable<Category>, ResourceIdentifiable<Category>, Versioned<Category>, WithKey

Category
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}")
             .plusStores(storesBuilder -> storesBuilder)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Category.

      Specified by:
      getId in interface BaseResource
      Specified by:
      getId in interface DomainResource<Category>
      Specified by:
      getId in interface Identifiable<Category>
      Specified by:
      getId in interface Versioned<Category>
      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Current version of the Category.

      Specified by:
      getVersion in interface BaseResource
      Specified by:
      getVersion in interface DomainResource<Category>
      Specified by:
      getVersion in interface Versioned<Category>
      Returns:
      version
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the Category was initially created.

      Specified by:
      getCreatedAt in interface BaseResource
      Returns:
      createdAt
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Category was last updated.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Valid @Valid LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the Category.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Valid @Valid CreatedBy getCreatedBy()

      IDs and references that created the Category.

      Returns:
      createdBy
    • getName

      @NotNull @Valid @NotNull @Valid LocalizedString getName()

      Name of the Category.

      Returns:
      name
    • getSlug

      @NotNull @Valid @NotNull @Valid LocalizedString 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 15 languages set in a Project.

      Returns:
      slug
    • getDescription

      @Valid @Valid LocalizedString getDescription()

      Description of the Category.

      Returns:
      description
    • getAncestors

      @NotNull @Valid @NotNull @Valid List<CategoryReference> getAncestors()

      Contains the parent path towards the root Category.

      Returns:
      ancestors
    • getParent

      @Valid @Valid CategoryReference getParent()

      Parent Category of this Category.

      Returns:
      parent
    • getOrderHint

      @NotNull @NotNull String 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 orderHint appear before those with a higher value (for example, 0.05 before 0.07).

      Returns:
      orderHint
    • getExternalId

      String getExternalId()

      Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).

      Returns:
      externalId
    • getMetaTitle

      @Valid @Valid LocalizedString getMetaTitle()

      Name of the Category used by external search engines for improved search engine performance.

      Returns:
      metaTitle
    • getMetaDescription

      @Valid @Valid LocalizedString getMetaDescription()

      Description of the Category used by external search engines for improved search engine performance.

      Returns:
      metaDescription
    • getMetaKeywords

      @Valid @Valid LocalizedString getMetaKeywords()

      Keywords related to the Category for improved search engine performance.

      Returns:
      metaKeywords
    • getCustom

      @Valid @Valid CustomFields getCustom()

      Custom Fields of the Category.

      Specified by:
      getCustom in interface Customizable<Category>
      Returns:
      custom
    • getAssets

      @Valid @Valid List<Asset> getAssets()

      Media related to the Category.

      Returns:
      assets
    • getKey

      String getKey()

      User-defined unique identifier of the Category.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getStores

      @NotNull @Valid @NotNull @Valid List<StoreKeyReference> getStores()

      Stores to which the Category is assigned and that you have permission to access.

      If stores is empty, the Category is global and available in every Store.

      If the Category is created via the Store-specific endpoint, the Store specified in the request path is automatically added to the field value.

      Returns:
      stores
    • setId

      void setId(String id)

      Unique identifier of the Category.

      Specified by:
      setId in interface BaseResource
      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Current version of the Category.

      Specified by:
      setVersion in interface BaseResource
      Parameters:
      version - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the Category was initially created.

      Specified by:
      setCreatedAt in interface BaseResource
      Parameters:
      createdAt - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Category was last updated.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Parameters:
      lastModifiedAt - value to be set
    • setLastModifiedBy

      void setLastModifiedBy(LastModifiedBy lastModifiedBy)

      IDs and references that last modified the Category.

      Parameters:
      lastModifiedBy - value to be set
    • setCreatedBy

      void setCreatedBy(CreatedBy createdBy)

      IDs and references that created the Category.

      Parameters:
      createdBy - value to be set
    • setName

      void setName(LocalizedString name)

      Name of the Category.

      Parameters:
      name - value to be set
    • setSlug

      void setSlug(LocalizedString slug)

      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 15 languages set in a Project.

      Parameters:
      slug - value to be set
    • setDescription

      void setDescription(LocalizedString description)

      Description of the Category.

      Parameters:
      description - value to be set
    • setAncestors

      void setAncestors(CategoryReference... ancestors)

      Contains the parent path towards the root Category.

      Parameters:
      ancestors - values to be set
    • setAncestors

      void setAncestors(List<CategoryReference> ancestors)

      Contains the parent path towards the root Category.

      Parameters:
      ancestors - values to be set
    • setParent

      void setParent(CategoryReference parent)

      Parent Category of this Category.

      Parameters:
      parent - value to be set
    • setOrderHint

      void setOrderHint(String 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 orderHint appear before those with a higher value (for example, 0.05 before 0.07).

      Parameters:
      orderHint - value to be set
    • setExternalId

      void setExternalId(String externalId)

      Additional identifier for external systems like customer relationship management (CRM) or enterprise resource planning (ERP).

      Parameters:
      externalId - value to be set
    • setMetaTitle

      void setMetaTitle(LocalizedString metaTitle)

      Name of the Category used by external search engines for improved search engine performance.

      Parameters:
      metaTitle - value to be set
    • setMetaDescription

      void setMetaDescription(LocalizedString metaDescription)

      Description of the Category used by external search engines for improved search engine performance.

      Parameters:
      metaDescription - value to be set
    • setMetaKeywords

      void setMetaKeywords(LocalizedString metaKeywords)

      Keywords related to the Category for improved search engine performance.

      Parameters:
      metaKeywords - value to be set
    • setCustom

      void setCustom(CustomFields custom)

      Custom Fields of the Category.

      Specified by:
      setCustom in interface Customizable<Category>
      Parameters:
      custom - value to be set
    • setAssets

      void setAssets(Asset... assets)

      Media related to the Category.

      Parameters:
      assets - values to be set
    • setAssets

      void setAssets(List<Asset> assets)

      Media related to the Category.

      Parameters:
      assets - values to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Category.

      Parameters:
      key - value to be set
    • setStores

      void setStores(StoreKeyReference... stores)

      Stores to which the Category is assigned and that you have permission to access.

      If stores is empty, the Category is global and available in every Store.

      If the Category is created via the Store-specific endpoint, the Store specified in the request path is automatically added to the field value.

      Parameters:
      stores - values to be set
    • setStores

      void setStores(List<StoreKeyReference> stores)

      Stores to which the Category is assigned and that you have permission to access.

      If stores is empty, the Category is global and available in every Store.

      If the Category is created via the Store-specific endpoint, the Store specified in the request path is automatically added to the field value.

      Parameters:
      stores - values to be set
    • of

      static Category of()
      factory method
      Returns:
      instance of Category
    • of

      static Category of(Category template)
      factory method to create a shallow copy Category
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      Category copyDeep()
      Specified by:
      copyDeep in interface BaseResource
    • deepCopy

      @Nullable static Category deepCopy(@Nullable Category template)
      factory method to create a deep copy of Category
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static CategoryBuilder builder()
      builder factory method for Category
      Returns:
      builder
    • builder

      static CategoryBuilder builder(Category template)
      create builder for Category instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCategory

      default <T> T withCategory(Function<Category,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • referenceTypeId

      static ReferenceTypeId referenceTypeId()
    • typeReference

      static tools.jackson.core.type.TypeReference<Category> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference