Package net.aifusion.metamodel
Class StructureValue
java.lang.Object
net.aifusion.metamodel.QualifiedElement
net.aifusion.metamodel.NamedElement
net.aifusion.metamodel.StructureValue
- All Implemented Interfaces:
CimEventGenerator
- Direct Known Subclasses:
CimInstance
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 Summary
Modifier and TypeMethodDescriptionbind()
Bind this structure value to a Java implementationCreate a Java object with properties cloned from this structure value Note that the returned object is not bound to this structure valuestatic StructureValue
createStructureValue
(CimStructure struct, Map<String, DataValue> propertyValues, String alias) Create a new Structure value from a given structure, and associated property valuesboolean
getAlias()
Get the alias value associated with this structure value, if anyGet the structure used to create this valueGet the CIM type of this elementGet the case-normalized (lower case) name for this elementgetName()
Get the name of this elementGet the names of all properties defined in this structure valuegetPropertyType
(String propertyName) Get the property type of a property in this structure valuegetPropertyValue
(String propertyName) Get the value of a property from this structure valueboolean
hasAlias()
Check if this structure value has an aliasint
hashCode()
boolean
hasNonNullProperty
(String propertyName) Check if this Structure Value has a non-null property valueboolean
hasProperty
(String propertyName) Check if the given property is defined in this structure valueboolean
isInstanceOf
(String className) Check if this instance/value is an instance of a given class/structureboolean
isInstanceOf
(CimStructure givenClass) Check if this instance/value is an instance of a given class/structurevoid
setPropertyValue
(String propertyName, DataValue propertyValue) Set the value of a property in this instancetoMOF()
Return the MOF representation of this elementtoString()
Methods inherited from class net.aifusion.metamodel.NamedElement
addListener, getAllQualifiers, getFullName, getNameSpacePath, getObjectPath, getQualifierValue, getSuperType, hasListener, hasQualifier, isAbstract, isSubTypeOf, removeListener
Methods inherited from class net.aifusion.metamodel.QualifiedElement
getQualifiers
-
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 valuepropertyValues
- - property values to be used for creating the structure valuealias
- - alias, if any for this Structure value- Returns:
- - constructed StructureValue
-
bind
Bind this structure value to a Java implementation- Returns:
- - bound java object with all properties bound
-
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
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
Get the structure used to create this value- Returns:
- - structure used to create this value
-
hasNonNullProperty
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
Get the value of a property from this structure value- Parameters:
propertyName
- - name of the property- Returns:
- - value of the property
-
setPropertyValue
Set the value of a property in this instance- Parameters:
propertyName
- - name of the propertypropertyValue
- - value to be set in the property
-
hasProperty
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
Get the names of all properties defined in this structure value- Returns:
- - set containing names of all properties defined in this structure value
-
getPropertyType
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
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
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
- Overrides:
equals
in classNamedElement
-
getName
Get the name of this element- Returns:
- - name of this element
- See Also:
-
getLowerCaseName
Get the case-normalized (lower case) name for this element- Returns:
- - name of this element normalized to lower case
- See Also:
-
getElementType
Get the CIM type of this element- Returns:
- - CIMType for this element
- See Also:
-
toMOF
Return the MOF representation of this element- Returns:
- - String containing MOF representation of this element
-
toString
-
hashCode
public int hashCode()
-