Package org.sblim.wbem.cim
Class CIMValue
- java.lang.Object
-
- org.sblim.wbem.cim.CIMValue
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class CIMValue extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CIMValue()
CIMValue(java.lang.Object pValue)
Deprecated.this constructor may lead to confusion when the data type of the specified argument can not be determined, such as the case of null arguments.CIMValue(java.lang.Object pValue, CIMDataType pDataType)
Construct an object of a cim value, using the specified data type.CIMValue(java.util.Vector pValue, CIMDataType pDataType)
Construct an object of cim value for a given vector, and the specified data type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Object
clone()
boolean
contains(java.lang.Object pValue)
Determines if the object argument passed to the method is contained as part of the vector or if the object argument is equivalent to the current value.boolean
equals(java.lang.Object obj)
int
getSize()
Returns the size of the current value.CIMDataType
getType()
Return the data type for this object.java.lang.Object
getValue()
Returns the value assigned to this object.int
hashCode()
boolean
isArrayValue()
Determines if the current value is an array type.boolean
isEmpty()
Determine no object has been assigned to the CIMValue.boolean
isNull()
Determines if the current value is null.boolean
isNullValue()
Determines if the current value is null.static void
main(java.lang.String[] args)
int
size()
Deprecated.use getSize instead of size()java.lang.String
toMOF()
Returns the MOF representation of this element.java.lang.String
toString()
-
-
-
Constructor Detail
-
CIMValue
public CIMValue(java.lang.Object pValue)
Deprecated.this constructor may lead to confusion when the data type of the specified argument can not be determined, such as the case of null arguments.Construct an object of a CIMValue. Other constructors are preferred than this one, because it may not determine the appropriate value type of the object passed as argument.- Parameters:
pValue
- The value
-
CIMValue
public CIMValue(java.lang.Object pValue, CIMDataType pDataType)
Construct an object of a cim value, using the specified data type.- Parameters:
pValue
- the value object contained by this CIMValue.pDataType
- the data type for this CIMValue.- Throws:
java.lang.IllegalArgumentException
-
CIMValue
public CIMValue(java.util.Vector pValue, CIMDataType pDataType)
Construct an object of cim value for a given vector, and the specified data type.- Parameters:
pValue
- A vector of objectspDataType
- An array data type- Throws:
java.lang.IllegalArgumentException
- if the elements from the vector does not match the specified data type.
-
CIMValue
protected CIMValue()
-
-
Method Detail
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
-
contains
public boolean contains(java.lang.Object pValue)
Determines if the object argument passed to the method is contained as part of the vector or if the object argument is equivalent to the current value.- Parameters:
pValue
- The value- Returns:
true
if pValue is contained in this cim value,false
otherwise
-
isEmpty
public boolean isEmpty()
Determine no object has been assigned to the CIMValue. This is if the value == null && the value type != null.- Returns:
true
if value is equal tonull
and data type is not null.
-
isNull
public boolean isNull()
Determines if the current value is null.- Returns:
true
if the current value is equal tonull
, otherwise returnsfalse
.
-
isNullValue
public boolean isNullValue()
Determines if the current value is null.- Returns:
true
if the current value is equal tonull
, otherwise returnsfalse
.
-
getSize
public int getSize()
Returns the size of the current value. If the value is a vector type, the size of the vector. If the value is equals to null, and a data type is provided returns the size of the data type, otherwise returns a SIZE_SINGLE value.- Returns:
- The size
-
size
public int size()
Deprecated.use getSize instead of size()Return the size of the current value. If the value is a vector type, returns the size of the vector. If the value is equals to null, and a data type is provided returns the size of the data type, otherwise returns a SIZE_SINGLE value.- Returns:
- The size
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getType
public CIMDataType getType()
Return the data type for this object.- Returns:
- The type
-
getValue
public java.lang.Object getValue()
Returns the value assigned to this object.- Returns:
- The value
-
isArrayValue
public boolean isArrayValue()
Determines if the current value is an array type.- Returns:
true
if the value is an array,false
otherwise
-
toMOF
public java.lang.String toMOF()
Returns the MOF representation of this element.- Returns:
- The MOF representation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
main
public static void main(java.lang.String[] args)
-
-