Class XMLCatalogImpl.CatalogEntry

java.lang.Object
org.opencastproject.mediapackage.XMLCatalogImpl.CatalogEntry
All Implemented Interfaces:
Serializable, Comparable<XMLCatalogImpl.CatalogEntry>, XmlElement
Enclosing class:
XMLCatalogImpl

public final class XMLCatalogImpl.CatalogEntry extends Object implements XmlElement, Comparable<XMLCatalogImpl.CatalogEntry>, Serializable
Element representation.
See Also:
  • Constructor Details

    • CatalogEntry

      public CatalogEntry(EName name, String value, Map<EName,String> attributes)
      Creates a new catalog element representation with name, value and attributes.
      Parameters:
      value - the element value
      attributes - the element attributes
  • Method Details

    • getQName

      public String getQName()
      Returns the qualified name of the entry as a string. The namespace of the entry has to be bound to a prefix for this method to succeed.
    • getEName

      public EName getEName()
      Returns the expanded name of the entry.
    • getValue

      public String getValue()
      Returns the element value.
      Returns:
      the value
    • hasAttributes

      public boolean hasAttributes()
      Returns true if the element contains attributes.
      Returns:
      true if the element contains attributes
    • getAttributes

      public Map<EName,String> getAttributes()
      Returns the element's attributes.
      Returns:
      the attributes
    • hasAttribute

      public boolean hasAttribute(EName name)
      Returns true if the element contains an attribute with the given name.
      Returns:
      true if the element contains the attribute
    • getAttribute

      public String getAttribute(EName name)
      Returns the attribute value for the given attribute.
      Returns:
      the attribute or null
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object that)
      Overrides:
      equals in class Object
    • toXml

      public Node toXml(Document document)
      Returns the XML representation of this entry.
      Specified by:
      toXml in interface XmlElement
      Parameters:
      document - the document
      Returns:
      the xml node
    • compareTo

      public int compareTo(XMLCatalogImpl.CatalogEntry o)
      Compare two catalog entries. Comparison order: - e_name - number of attributes (less come first) - attribute comparison (e_name -> value)
      Specified by:
      compareTo in interface Comparable<XMLCatalogImpl.CatalogEntry>
    • toString

      public String toString()
      Overrides:
      toString in class Object