Class NamedElement

java.lang.Object
net.aifusion.metamodel.QualifiedElement
net.aifusion.metamodel.NamedElement
All Implemented Interfaces:
CimEventGenerator
Direct Known Subclasses:
CimEnumeration, CimStructure, QualifierType, StructureValue

public abstract class NamedElement extends QualifiedElement implements CimEventGenerator
Base class for all CIM Elements that reside in a namespace. Named elements can be located via their ObjectPath, and can generate events
Author:
Sharad Singhal
  • Method Details

    • addListener

      public boolean addListener(CimEventType type, CimListener listener)
      Description copied from interface: CimEventGenerator
      Add a listener to this generator
      Specified by:
      addListener in interface CimEventGenerator
      Parameters:
      type - - type of event the listener wants
      listener - - CimListener interested in events
      Returns:
      - true if listener was successfully added, false otherwise
    • removeListener

      public void removeListener(CimEventType type, CimListener listener)
      Description copied from interface: CimEventGenerator
      Remove a listener from this generator
      Specified by:
      removeListener in interface CimEventGenerator
      Parameters:
      type - of event the listener wants
      listener - - CimListener to be removed
    • hasListener

      public boolean hasListener(CimEventType type, CimListener listener)
      Description copied from interface: CimEventGenerator
      Check if this event generator has a listener for an event type
      Specified by:
      hasListener in interface CimEventGenerator
      Parameters:
      type - - type of event
      listener - - listener to check. If null, check if any listener is registered
      Returns:
      - true if the generator has at least one registered listener for the event type, false otherwise
    • getObjectPath

      public ObjectPath getObjectPath()
      Get the object path for this named element
      Returns:
      - object path for this element
    • getNameSpacePath

      public NameSpacePath getNameSpacePath()
      Get the namespace path for this named element
      Returns:
      - namespace path for this element
    • getSuperType

      public NamedElement getSuperType()
      Get the direct superType of this element, if any
      Returns:
      - direct superType of this element, null if none defined
    • isSubTypeOf

      public boolean isSubTypeOf(String name)
      Check if this NamedElement is a subType of another NamedElement
      Parameters:
      name - - Name of the NamedElement to be checked
      Returns:
      - true if the given name is the name of this element, or any of its superTypes. False otherwise
    • isAbstract

      public boolean isAbstract()
      Check if this NamedElement is abstract
      Returns:
      - true if this NamedElement is abstract, false otherwise
    • getFullName

      public String getFullName()
      Return the full name of this Named element. The fully qualified name of the element is (... SupName1.SupName0.Name), where Name is the name of this element, SupName0 is the immediate superType, SupName1 is the next ancestor, and so on. If the element does not have a superType, its name is returned
      Returns:
      - fully qualified name of this element
      See Also:
    • getQualifierValue

      public DataValue getQualifierValue(String qualifierName)
      Get the value of a qualifier declared on this element, inherited by it, or the default defined in standard qualifiers.
      Overrides:
      getQualifierValue in class QualifiedElement
      Parameters:
      qualifierName - - name of the qualifier to search
      Returns:
      - value of the qualifier or default from a standard qualifier. Null if none defined
      See Also:
    • getAllQualifiers

      public List<Qualifier> getAllQualifiers()
      Get all qualifiers declared on, or inherited by this qualified Element
      Returns:
      - list of all qualifiers. Empty list is returned if none are declared
      See Also:
    • hasQualifier

      public boolean hasQualifier(String qName)
      Check if this qualified element has a particular qualifier declared in it (or inherited by it)
      Overrides:
      hasQualifier in class QualifiedElement
      Parameters:
      qName - - name of the qualifier
      Returns:
      - true if the qualified element has a qualifier declared in it (or inherited by it), false otherwise
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class QualifiedElement
    • getName

      public String getName()
      Get the name of this element
      Returns:
      - name of this element
      See Also:
    • getLowerCaseName

      public String getLowerCaseName()
      Get the case-normalized (lower case) name for this element
      Returns:
      - name of this element normalized to lower case
      See Also:
    • getElementType

      public ElementType getElementType()
      Get the CIM type of this element
      Returns:
      - CIMType for this element
      See Also:
    • toMOF

      public String toMOF()
      Return the MOF representation of this element
      Returns:
      - String containing MOF representation of this element
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object