public interface Category extends Resource<Category>, WithLocalizedSlug, MetaAttributes, Custom, WithKey
A category can have custom fields.
Consult the documentation for categories for more information.
CategoryCreateCommand,
CategoryUpdateCommand,
CategoryDeleteCommand,
CategoryQuery,
CategoryByIdGet,
CategoryTree,
ProductData.getCategories(),
ProductData.getCategoryOrderHints(),
ProductProjection.getCategories(),
ProductProjection.getCategoryOrderHints(),
AddToCategory,
RemoveFromCategory| Modifier and Type | Method and Description |
|---|---|
List<Reference<Category>> |
getAncestors() |
List<Asset> |
getAssets() |
CustomFields |
getCustom()
Custom fields.
|
LocalizedString |
getDescription()
Description for this category.
|
String |
getExternalId()
ID which can be used as additional identifier for external Systems like CRM or ERP.
|
String |
getKey()
User-specific unique identifier for the Category.
|
LocalizedString |
getMetaDescription()
SEO meta description.
|
LocalizedString |
getMetaKeywords()
SEO meta keywords.
|
LocalizedString |
getMetaTitle()
SEO meta title.
|
LocalizedString |
getName()
Name of this category.
|
String |
getOrderHint()
An attribute as base for a custom category order in one level.
|
Reference<Category> |
getParent()
Reference to the parent category.
|
LocalizedString |
getSlug()
Human-readable identifier usually used as deep-link URL part.
|
static Reference<Category> |
reference(String id) |
static Reference<Category> |
referenceOfId(String id)
Creates a reference for one item of this class by a known ID.
|
static String |
referenceTypeId()
A type hint for references which resource type is linked in a reference.
|
static String |
resourceTypeId()
An identifier for this resource which supports
CustomFields. |
default Reference<Category> |
toReference()
Creates a reference to this resource, the reference may not be filled.
|
static String |
toString(Category category) |
static com.fasterxml.jackson.core.type.TypeReference<Category> |
typeReference()
Creates a container which contains the full Java type information to deserialize this class from JSON.
|
getCreatedAt, getId, getLastModifiedAt, getVersionhasSameIdAs, toResourceIdentifiermetaAttributesOf, metaAttributesOfLocalizedString getName()
ChangeNameLocalizedString getSlug()
getSlug in interface WithLocalizedSlugChangeSlug@Nullable LocalizedString getDescription()
SetDescription@Nullable Reference<Category> getParent()
ChangeParent@Nullable String getOrderHint()
ChangeOrderHint@Nullable String getExternalId()
SetExternalId@Nullable LocalizedString getMetaTitle()
getMetaTitle in interface MetaAttributesSetMetaTitle@Nullable LocalizedString getMetaDescription()
getMetaDescription in interface MetaAttributesSetMetaDescription@Nullable LocalizedString getMetaKeywords()
getMetaKeywords in interface MetaAttributesSetMetaKeywords@Nullable CustomFields getCustom()
getCustom in interface CustomCustom,
SetCustomField,
SetCustomTypedefault Reference<Category> toReference()
ReferenceabletoReference in interface Referenceable<Category>toReference in interface Resource<Category>static String resourceTypeId()
CustomFields.TypeDraft.getResourceTypeIds(),
Customstatic String referenceTypeId()
Reference.getTypeId()static com.fasterxml.jackson.core.type.TypeReference<Category> typeReference()
static Reference<Category> referenceOfId(String id)
An example for categories but this applies for other resources, too:
final String categoryIdFromFormOrSession = "84ac4271-0fec-49d0-9fee-55586c565c58"; final Reference<Category> categoryReference = Category.referenceOfId(categoryIdFromFormOrSession); assertThat(categoryReference.getId()).isEqualTo(categoryIdFromFormOrSession);See the test code.
If you already have a resource object, then use toReference() instead:
final Category category = getCategory1(); final Reference<Category> categoryReference = category.toReference(); assertThat(category.getId()).isEqualTo(categoryReference.getId());See the test code.
id - the ID of the resource which should be referenced.