Class MCRAbstractCategoryImpl

java.lang.Object
org.mycore.datamodel.classifications2.impl.MCRAbstractCategoryImpl
All Implemented Interfaces:
MCRCategory
Direct Known Subclasses:
MCRCategoryImpl

public abstract class MCRAbstractCategoryImpl extends Object implements MCRCategory
Since:
2.0
Version:
$Revision$ $Date$
Author:
Thomas Scheffler (yagee)
  • Field Details

  • Constructor Details

    • MCRAbstractCategoryImpl

      public MCRAbstractCategoryImpl()
  • Method Details

    • getChildren

      public List<MCRCategory> getChildren()
      Description copied from interface: MCRCategory
      Returns a list of subcategories. Implementors must never return null if no children are present. As this method may need a new call the underlaying persistence layer use hasChildren() if you just want to know if subcategories are present. Changes to the list may not affect the underlaying persistence layer.
      Specified by:
      getChildren in interface MCRCategory
      Returns:
      subcategories
      See Also:
    • setChildrenUnlocked

      protected abstract void setChildrenUnlocked(List<MCRCategory> children)
    • getId

      public MCRCategoryID getId()
      Specified by:
      getId in interface MCRCategory
      Returns:
      the id
    • setId

      public void setId(MCRCategoryID id)
      Specified by:
      setId in interface MCRCategory
      Parameters:
      id - the id to set
    • getLabels

      public SortedSet<MCRLabel> getLabels()
      Specified by:
      getLabels in interface MCRCategory
      Returns:
      the labels
    • getRoot

      public MCRCategory getRoot()
      Description copied from interface: MCRCategory
      Returns root category (the classification).
      Specified by:
      getRoot in interface MCRCategory
      Returns:
      the root category
    • getURI

      public URI getURI()
      Description copied from interface: MCRCategory
      Returns the URI associated with this category.
      Specified by:
      getURI in interface MCRCategory
      Returns:
      the URI
    • setURI

      public void setURI(URI uri)
      Specified by:
      setURI in interface MCRCategory
      Parameters:
      uri - the URI to set
    • hasChildren

      public boolean hasChildren()
      Description copied from interface: MCRCategory
      Tells if this category has subcategories.
      Specified by:
      hasChildren in interface MCRCategory
      Returns:
      true if this category has subcategories
      See Also:
    • isCategory

      public final boolean isCategory()
      Specified by:
      isCategory in interface MCRCategory
      Returns:
      true if this is not a root category
      See Also:
    • isClassification

      public final boolean isClassification()
      Specified by:
      isClassification in interface MCRCategory
      Returns:
      true if this is a root category
    • getParent

      public MCRCategory getParent()
      Description copied from interface: MCRCategory
      Returns the parent element
      Specified by:
      getParent in interface MCRCategory
      Returns:
      the categories parent or null if isClassification()==true or category currently not attached
    • setParent

      public void setParent(MCRCategory parent)
    • getCurrentLabel

      public Optional<MCRLabel> getCurrentLabel()
      Specified by:
      getCurrentLabel in interface MCRCategory
      Returns:
      the label in the current language (if available), default language (if available), any language in MCR.Metadata.Languages(if available), any other language that does not start with x- or any other language
    • getLabel

      public Optional<MCRLabel> getLabel(String lang)
      Specified by:
      getLabel in interface MCRCategory
      Returns:
      the label in the specified language (if available) or null
    • toString

      public String toString()
      Overrides:
      toString in class Object