Interface CategoryDraft

All Superinterfaces:
CustomizableDraft<CategoryDraft>, Draft<CategoryDraft>, WithKey

public interface CategoryDraft extends CustomizableDraft<CategoryDraft>, WithKey, Draft<CategoryDraft>
CategoryDraft
Example to create an instance using the builder pattern

     CategoryDraft categoryDraft = CategoryDraft.builder()
             .name(nameBuilder -> nameBuilder)
             .slug(slugBuilder -> slugBuilder)
             .build()
 
  • Method Details

    • 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. 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

      @Valid @Valid LocalizedString getDescription()

      Description of the Category.

      Returns:
      description
    • getParent

      @Valid @Valid CategoryResourceIdentifier getParent()

      Parent Category of the Category. The parent can be set by its id or key.

      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

      @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 CustomFieldsDraft getCustom()

      Custom Fields for the Category.

      Specified by:
      getCustom in interface CustomizableDraft<CategoryDraft>
      Returns:
      custom
    • getAssets

      @Valid @Valid List<AssetDraft> getAssets()

      Media related to the Category.

      Returns:
      assets
    • getKey

      String getKey()

      User-defined unique identifier for the Category.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • 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. 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

      void setDescription(LocalizedString description)

      Description of the Category.

      Parameters:
      description - value to be set
    • setParent

      void setParent(CategoryResourceIdentifier parent)

      Parent Category of the Category. The parent can be set by its id or key.

      Parameters:
      parent - value to be set
    • setOrderHint

      void setOrderHint(String orderHint)

      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

      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(CustomFieldsDraft custom)

      Custom Fields for the Category.

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

      void setAssets(AssetDraft... assets)

      Media related to the Category.

      Parameters:
      assets - values to be set
    • setAssets

      void setAssets(List<AssetDraft> assets)

      Media related to the Category.

      Parameters:
      assets - values to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier for the Category.

      Parameters:
      key - value to be set
    • of

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

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

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

      static CategoryDraftBuilder builder()
      builder factory method for CategoryDraft
      Returns:
      builder
    • builder

      static CategoryDraftBuilder builder(CategoryDraft template)
      create builder for CategoryDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCategoryDraft

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

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