Class CimClass

All Implemented Interfaces:
CimEventGenerator
Direct Known Subclasses:
CimInterface

public class CimClass extends CimStructure
Class to represent a CIM Class definition. A CIM Class can declare methods (operations) in addition to properties. Classes are instantiated by CIM Instances. Classes are constructed by the MOFParser using MOF definitions.
Author:
Sharad Singhal
See Also:
  • Method Details

    • getMethodNames

      public Set<String> getMethodNames()
      Get the names of all methods defined in this class
      Returns:
      - set containing method names defined in this class
    • getAllMethodNames

      public Set<String> getAllMethodNames()
      Get the names of all methods defined in this class, or its superTypes
      Returns:
      - names of all methods in this class or its superclass hierarchy
    • hasMethod

      public boolean hasMethod(String methodName)
      Check if this class or one of its supertypes contains a given method
      Parameters:
      methodName - - name of the method to check
      Returns:
      - true if the class contains a method with the given name, false otherwise
    • getMethodReturnType

      public DataType getMethodReturnType(String methodName)
      Get the return type of a method defined in this class
      Parameters:
      methodName - - name of the method desired
      Returns:
      - data type returned by the method. Null if no such method exists
    • getMethodParameters

      public List<CimParameter> getMethodParameters(String methodName)
      Get the parameters associated with a given method
      Parameters:
      methodName - - name of the method desired
      Returns:
      - list containing method parameters. Null if no such method defined
    • getMethodQualifiers

      public List<Qualifier> getMethodQualifiers(String methodName)
      Get the qualifiers declared on a method
      Parameters:
      methodName - - name of the method
      Returns:
      - all qualifiers on the method. Empty if none declared
    • hasMethodQualifier

      public boolean hasMethodQualifier(String methodName, String qualifierName)
      Check if a given qualifier is declared on a method
      Parameters:
      methodName - - name of the method
      qualifierName - - name of the qualifier
      Returns:
      - true if the method has the given qualifier, false otherwise
    • getMethodQualifierValue

      public DataValue getMethodQualifierValue(String methodName, String qualifierName)
      Get the value of a method qualifier in this class
      Parameters:
      methodName - - name of the method
      qualifierName - - name of the qualifier
      Returns:
      - value of the qualifier
    • getMethodOriginClass

      public String getMethodOriginClass(String methodOrPropertyName)
      Get the name of the class or interface where this property or method is defined
      Parameters:
      methodOrPropertyName - - name of the method
      Returns:
      - name of the origin class. Null if no such property or method exists
    • getReferencedStructure

      public CimStructure getReferencedStructure(String methodOrPropertyName)
      Get the Structure returned by the method or property
      Overrides:
      getReferencedStructure in class CimStructure
      Parameters:
      methodOrPropertyName - - name of the method or property
      Returns:
      - structure returned by method or property, null if the method or property does not return one
    • getReferencedEnum

      public CimEnumeration getReferencedEnum(String methodOrPropertyName)
      Get the Enumeration returned by the method or property
      Overrides:
      getReferencedEnum in class CimStructure
      Parameters:
      methodOrPropertyName - - name of the method or property
      Returns:
      - Enumeration returned by method or property, null if the method or property does not return one
    • getReferencedClass

      public String getReferencedClass(String methodOrPropertyName)
      Get the name of the referenced class returned by the method or property
      Overrides:
      getReferencedClass in class CimStructure
      Parameters:
      methodOrPropertyName - - name of the method or property
      Returns:
      - referenced class returned by method or property, null if the method or property does not return one
    • invokeMethod

      public DataValue invokeMethod(String methodName, List<CimParameter> cimParameters)
      Invoke a method on this instance
      Parameters:
      methodName - - name of the method to invoke
      cimParameters - - parameters required by the method
      Returns:
      - returned value from the method
    • equals

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