Class CimStructure

All Implemented Interfaces:
CimEventGenerator
Direct Known Subclasses:
CimClass

public class CimStructure extends NamedElement
Class to model a CIM CimStructure. A CIM Structure is a template for a named value containing other name-value pairs.
Author:
Sharad Singhal
See Also:
  • Method Details

    • getInterfaceNames

      public Set<String> getInterfaceNames()
      Get the names of all interfaces locally defined in this structure
      Returns:
      - set containing names of all defined interfaces. Empty if none defined
      See Also:
    • getAllInterfaceNames

      public Set<String> getAllInterfaceNames()
      Get names of interfaces defined in this structure or its superTypes.
      Returns:
      - set containing names of defined interfaces. Empty if none defined
      See Also:
    • implementsInterface

      public boolean implementsInterface(String interfaceName)
      Check if this structure or it's superTypes implement a given interface
      Parameters:
      interfaceName - - name of the property
      Returns:
      - true if the structure implements the interface, false otherwise
    • getInterface

      public CimInterface getInterface(String interfaceName)
      get an interface defined within this structure or one of its supertypes
      Parameters:
      interfaceName - - name of the local interface
      Returns:
      - the given Interface, null if no such interface exists
    • getStructureNames

      public Set<String> getStructureNames()
      Get the names of structures locally defined in this structure or interfaces implemented by it
      Returns:
      - set containing names of all locally defined structures. Empty if none defined
    • getAllStructureNames

      public Set<String> getAllStructureNames()
      Get the names of locally defined structures in this structure, or its supertypes
      Returns:
      - names of locally defined structures
    • hasStructure

      public boolean hasStructure(String structureName)
      Check if this structure (or one of its supertypes) defines a structure
      Parameters:
      structureName - - name of the structure
      Returns:
      - true if the structure defines the given structure, false otherwise
    • getStructure

      public CimStructure getStructure(String structureName)
      get a structure defined within this structure, or one of its supertypes
      Parameters:
      structureName - - name of the structure
      Returns:
      - the given structure, null if no such structure exists
    • getEnumerationNames

      public Set<String> getEnumerationNames()
      Get the names of all enumerations locally defined in this structure
      Returns:
      - name of all defined enumerations. Empty if none defined
    • getAllEnumerationNames

      public Set<String> getAllEnumerationNames()
      Get the names of all enumerations defined in this structure (or its supertypes)
      Returns:
      - name of all defined enumerations. Empty if none defined
    • hasEnumeration

      public boolean hasEnumeration(String enumerationName)
      Check if this structure defines a local Enumeration
      Parameters:
      enumerationName - - name of the local Enumeration
      Returns:
      - true if the structure defines the given local enumeration, false otherwise
    • getEnumeration

      public CimEnumeration getEnumeration(String enumerationName)
      get a local Enumeration defined in this structure
      Parameters:
      enumerationName - - name of the local Enumeration
      Returns:
      - the given local enumeration, null if no such Enumeration
    • getPropertyNames

      public Set<String> getPropertyNames()
      Get names of all properties defined in this structure
      Returns:
      - mixed case names of all properties defined locally in this structure
    • getAllPropertyNames

      public Set<String> getAllPropertyNames()
      Get names of all properties defined in this structure or its supertypes
      Returns:
      - mixed case names of all properties defined in this structure
    • hasProperty

      public boolean hasProperty(String propertyName)
      Check if this structure has a given property
      Parameters:
      propertyName - - name of the property
      Returns:
      - true if the structure has the given property, false otherwise
    • getPropertyOriginClass

      public String getPropertyOriginClass(String propertyName)
      Get the origin class for a property defined in this structure
      Parameters:
      propertyName - - name of the property
      Returns:
      - class where this property is defined. Null if no such property exists
    • getPropertyQualifiers

      public List<Qualifier> getPropertyQualifiers(String propertyName)
      Get the qualifiers declared on a property
      Parameters:
      propertyName - - name of the property
      Returns:
      - all qualifiers on the property. Empty if none declared
    • hasKeys

      public boolean hasKeys()
      Check if this structure (or its superType hierarchy) has at least one key property defined
      Returns:
      - true if this structure has a key property in it, false otherwise
    • getPropertyValue

      public DataValue getPropertyValue(String propertyName)
      Return the value of a property defined in this structure
      Parameters:
      propertyName - - name of the property to be checked
      Returns:
      - value of the property. Null if no such property
      Throws:
      ModelException - if a non-static property is read
    • getDefaultPropertyValue

      public DataValue getDefaultPropertyValue(String propertyName)
      Get the default value of a property
      Parameters:
      propertyName - - name of the property to be checked
      Returns:
      - value of the property. Null if no such property, or no default is present
    • setPropertyValue

      public void setPropertyValue(String propertyName, DataValue propertyValue)
      Set the value of a property in this structure
      Parameters:
      propertyName - - name of the property
      propertyValue - - value to be set in the property
      Throws:
      ModelException - if property does not exist or is not static
    • getReferencedStructure

      public CimStructure getReferencedStructure(String propertyName)
      Get the structure associated with a structureValue property
      Parameters:
      propertyName - - name of the property
      Returns:
      - structure associated with the property. Null if the property does not exist, or is not a structure property
    • getReferencedEnum

      public CimEnumeration getReferencedEnum(String propertyName)
      Get the Enumeration associated with a EnumerationValue property
      Parameters:
      propertyName - - name of the properfy
      Returns:
      - Enumeration associated with the property. Null if the property does not exist, or is not an enum property
    • getReferencedClass

      public String getReferencedClass(String propertyName)
      Get the name of the class referenced by a reference property
      Parameters:
      propertyName - - name of the property
      Returns:
      - name of the class referenced by this property. Null if the property does not exist, or is not an object reference
    • getPropertyType

      public DataType getPropertyType(String propertyName)
      Get the data type associated with a given property
      Parameters:
      propertyName - - name of the property
      Returns:
      - data type associated with that property. Null if no such property exists
    • getPropertyQualifierValue

      public DataValue getPropertyQualifierValue(String propertyName, String qualifierName)
      Get the value of a property qualifier
      Parameters:
      propertyName - - name of the property
      qualifierName - - name of the qualifier
      Returns:
      - value of the qualifier. Null if the property does not exist, or the qualifier does not exist
    • hasPropertyQualifier

      public boolean hasPropertyQualifier(String propertyName, String qualifierName)
      Test if a property has a given qualifier
      Parameters:
      propertyName - - name of the property to test
      qualifierName - - name of the qualifier to test
      Returns:
      - true of the property has the given qualifier. False otherwise
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class NamedElement
    • 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