Class StructureValue

All Implemented Interfaces:
CimEventGenerator
Direct Known Subclasses:
CimInstance

public class StructureValue extends NamedElement
Class to represent CimStructure values. A structure value encapsulates a set of key-value pairs. It can be created from a CimStructure as a template using the factory method createStructureValue(CimStructure, Map, String).
Author:
Sharad Singhal
  • Method Details

    • createStructureValue

      public static StructureValue createStructureValue(CimStructure struct, Map<String,DataValue> propertyValues, String alias)
      Create a new Structure value from a given structure, and associated property values
      Parameters:
      struct - - CimStructure to be used in creating the value
      propertyValues - - property values to be used for creating the structure value
      alias - - alias, if any for this Structure value
      Returns:
      - constructed StructureValue
    • bind

      public Object bind()
      Bind this structure value to a Java implementation
      Returns:
      - bound java object with all properties bound
    • createJavaObject

      public Object createJavaObject()
      Create a Java object with properties cloned from this structure value Note that the returned object is not bound to this structure value
      Returns:
      a java object initialized with properties from this structure value
    • getAlias

      public String getAlias()
      Get the alias value associated with this structure value, if any
      Returns:
      - alias value, if any. Null if no alias was defined
    • hasAlias

      public boolean hasAlias()
      Check if this structure value has an alias
      Returns:
      - true if this structure value has an alias, false otherwise
    • getCreationStruct

      public CimStructure getCreationStruct()
      Get the structure used to create this value
      Returns:
      - structure used to create this value
    • hasNonNullProperty

      public boolean hasNonNullProperty(String propertyName)
      Check if this Structure Value has a non-null property value
      Parameters:
      propertyName - - name of the property
      Returns:
      - true if the structure value has a non-null property with the given name, false otherwise
    • getPropertyValue

      public DataValue getPropertyValue(String propertyName)
      Get the value of a property from this structure value
      Parameters:
      propertyName - - name of the property
      Returns:
      - value of the property
    • setPropertyValue

      public void setPropertyValue(String propertyName, DataValue propertyValue)
      Set the value of a property in this instance
      Parameters:
      propertyName - - name of the property
      propertyValue - - value to be set in the property
    • hasProperty

      public boolean hasProperty(String propertyName)
      Check if the given property is defined in this structure value
      Parameters:
      propertyName - - name of the property to be checked
      Returns:
      - true if the property exists in this structure value, false otherwise
    • getPropertyNames

      public Set<String> getPropertyNames()
      Get the names of all properties defined in this structure value
      Returns:
      - set containing names of all properties defined in this structure value
    • getPropertyType

      public DataType getPropertyType(String propertyName)
      Get the property type of a property in this structure value
      Parameters:
      propertyName - - name of the property to get the type
      Returns:
      - data type of the property
    • isInstanceOf

      public boolean isInstanceOf(CimStructure givenClass)
      Check if this instance/value is an instance of a given class/structure
      Parameters:
      givenClass - - class/structure to check
      Returns:
      - true if this instance is an instance of the given class/structure (or one of its superTypes)
    • isInstanceOf

      public boolean isInstanceOf(String className)
      Check if this instance/value is an instance of a given class/structure
      Parameters:
      className - - name of the class/structure to check
      Returns:
      - true if the instance/value is an instance of the given class/structure, 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