javax.cim
Class CIMProperty

java.lang.Object
  extended byjavax.cim.CIMElement
      extended byjavax.cim.CIMTypedElement
          extended byjavax.cim.CIMValuedElement
              extended byjavax.cim.CIMProperty
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable
Direct Known Subclasses:
CIMClassProperty

public class CIMProperty
extends javax.cim.CIMValuedElement
implements java.io.Serializable, java.lang.Comparable

This class represents a CIM Property as defined by the Distributed Management Task Force (DMTF) CIM Infrastructure Specification (DSP004). A CIM Property Object consists of a name, data type and value. The CIM Property object also includes a flag to signify whether the property is a key property (used as part of the name of the CIM element), a flag to signify whether it was propgated from a parent class and the class origin information (where the property was originally defined).

Since:
JSR48 1.0.0
See Also:
Serialized Form

Constructor Summary
CIMProperty(java.lang.String name, CIMDataType type, java.lang.Object value, boolean key, boolean propagated, java.lang.String originClass)
          Constructs a CIMProperty to be used in instances.
 
Method Summary
 int compareTo(java.lang.Object p)
          Compares this property name to the CIMProperty passed in.
 boolean equals(java.lang.Object obj)
          Compares this object against the specified object.
 CIMDataType getDataType()
          Returns the CIMDataType for this CIM Element.
 java.lang.String getOriginClass()
          Returns the class in which this property was defined or overridden.
 java.lang.Object getValue()
          Returns the value for this CIM Element.
 boolean isKey()
          Convenience method for determining if this property is a Key.
 boolean isPropagated()
          Determines if this property is Propagated.
 java.lang.String toString()
          Returns a String representation of the CIMElement This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations.
 
Methods inherited from class javax.cim.CIMElement
getName, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CIMProperty

public CIMProperty(java.lang.String name,
                   CIMDataType type,
                   java.lang.Object value,
                   boolean key,
                   boolean propagated,
                   java.lang.String originClass)
Constructs a CIMProperty to be used in instances. For a CIMClass CIMClassProperty should be used.

Parameters:
name - The name of the property.
type - The CIMDataType of the property
value - The value of the property.
key - true if the property is a key; otherwise false.
propagated - true if the value was propogated from the class
originClass - The class in which this property was defined or overriden.
Method Detail

compareTo

public int compareTo(java.lang.Object p)
Compares this property name to the CIMProperty passed in.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
p - the CIMProperty to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this Object.

equals

public boolean equals(java.lang.Object obj)
Compares this object against the specified object. The result is true if and only if the argument is not null and is a CIMProperty that represents the same name, type and value as this object.

Parameters:
obj - - the object to compare with.
Returns:
true if the objects are the same; false otherwise.

getOriginClass

public java.lang.String getOriginClass()
Returns the class in which this property was defined or overridden.

Returns:
Name of class where this property was defined.

isKey

public boolean isKey()
Convenience method for determining if this property is a Key.

Returns:
true if this property is a key.

isPropagated

public boolean isPropagated()
Determines if this property is Propagated. When this property is part of a class, this value designates that the classorigin value is the same as the class name.

Returns:
true if this property is propagated.

getValue

public java.lang.Object getValue()
Returns the value for this CIM Element.

Returns:
Object The value of the CIM Element. null is a valid value.

toString

public java.lang.String toString()
Returns a String representation of the CIMElement This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
toString in class CIMElement
Returns:
string representation of this element

getDataType

public CIMDataType getDataType()
Returns the CIMDataType for this CIM Element.

Returns:
CIMDataType of this CIM element.


Java™ WBEM (JSR48) 1.0.0 API