Package net.aifusion.metamodel
Class DataValue
java.lang.Object
net.aifusion.metamodel.DataValue
This class encapsulates all CIM data values
- Author:
- Sharad Singhal
-
Constructor Summary
ConstructorDescriptionCreate a data dataValue from some java objectCreate a data dataValue from a given component type and dataValueCreate a data dataValue from an array of string valuesCreate a data dataValue from the given type and dataValue -
Method Summary
-
Constructor Details
-
DataValue
Create a data dataValue from some java object- Parameters:
value
- - java dataValue to be encapsulated. Can be any type defined in DataType- Throws:
ModelException
- if given java object is null, or does not represent a valid CIM data type- See Also:
-
DataValue
Create a data dataValue from the given type and dataValue- Parameters:
type
- - expected data typevalue
- - java object of the expected data type (may be null)- Throws:
ModelException
- if type is null, or dataValue does not match type- See Also:
-
DataValue
Create a data dataValue from a given component type and dataValue- Parameters:
type
- - string containing expected data typevalue
- - string containing the expected data dataValue- Throws:
ModelException
- if type is null or an array type, or if the given string value cannot be converted to the corresponding type- See Also:
-
DataValue
Create a data dataValue from an array of string values- Parameters:
type
- - string containing expected array typevalue
- - array containing string representations of the expected values- Throws:
ModelException
- if type is null or a component type, or if dataValue cannot be converted to the given type
-
-
Method Details
-
getType
Get the type of the data dataValue- Returns:
- - CIM data type for this dataValue
-
getValue
Get the java value in this dataValue. Note that for array values, a shallow copy of the underlying array is returned- Returns:
- - value encapsulated in this dataValue
-
toMOF
Get the MOF representation of this data dataValue- Returns:
- - string containing the MOF representation of this data dataValue
-
toString
-
hashCode
public int hashCode() -
equals
-