java.lang.Object
org.ametys.plugins.workspaces.categories.Category
All Implemented Interfaces:
Tag

public class Category extends Object implements Tag
Class representing a category.
  • Constructor Details

    • Category

      public Category(String id)
      Constructor
      Parameters:
      id - The id of the tag. The id must be unique.
    • Category

      public Category(String id, String name, Category parent, I18nizableText title, I18nizableText description)
      Constructor
      Parameters:
      id - The id of the tag. The id must be unique.
      name - The name of the tag. The name must be unique. The name is the same as the id except for JCR tag.
      parent - The parent tag (can be null if the tag has no parent)
      title - the tag title
      description - the tag description
    • Category

      public Category(String id, String name, String color, Category parent, I18nizableText title, I18nizableText description)
      Constructor
      Parameters:
      id - The id of the tag. The id must be unique.
      name - The name of the tag. The name must be unique. The name is the same as the id except for JCR tag.
      color - the color
      parent - The parent tag (can be null if the tag has no parent)
      title - the tag title
      description - the tag description
  • Method Details

    • getId

      public String getId()
      Description copied from interface: Tag
      Get the tag unique id.
      Specified by:
      getId in interface Tag
      Returns:
      The unique id
    • getName

      public String getName()
      Description copied from interface: Tag
      Get the tag name.
      Specified by:
      getName in interface Tag
      Returns:
      The tag name
    • getTitle

      Description copied from interface: Tag
      Retrieves the title.
      Specified by:
      getTitle in interface Tag
      Returns:
      the title.
    • getDescription

      Description copied from interface: Tag
      Retrieves the description.
      Specified by:
      getDescription in interface Tag
      Returns:
      the description.
    • getColor

      public String getColor()
      Get the color category
      Returns:
      the color
    • getParentName

      Description copied from interface: Tag
      Get the parent name.
      Specified by:
      getParentName in interface Tag
      Returns:
      The parent name.
    • getParent

      public Category getParent()
      Description copied from interface: Tag
      Get the parent tag
      Specified by:
      getParent in interface Tag
      Returns:
      The parent tag or null if the tag has no parent.
    • addTag

      public void addTag(Tag tag)
      Description copied from interface: Tag
      Add a new child tag.
      Specified by:
      addTag in interface Tag
      Parameters:
      tag - The tag to add
    • getTags

      Description copied from interface: Tag
      Retrieves the Set of child tags
      Specified by:
      getTags in interface Tag
      Returns:
      The child tags in a Map
    • getTag

      public Category getTag(String tagId)
      Description copied from interface: Tag
      Try to get a child tag by its id
      Specified by:
      getTag in interface Tag
      Parameters:
      tagId - The id of the child tag
      Returns:
      The child tag or null if not existing
    • hasTag

      public boolean hasTag(String tagId)
      Description copied from interface: Tag
      Determines if a tag exists
      Specified by:
      hasTag in interface Tag
      Parameters:
      tagId - The tag id
      Returns:
      true if the tag exists
    • setTags

      public void setTags(Map<String,? extends Tag> tags)
      Description copied from interface: Tag
      Set the child tags
      Specified by:
      setTags in interface Tag
      Parameters:
      tags - The Map of Tag to set