javax.cim
Class CIMClassProperty

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

public class CIMClassProperty
extends CIMProperty
implements CIMQualifiedElementInterface, java.io.Serializable

This class represents a CIM property (when used for a CIMClass) as defined by the Distributed Management Task Force (DMTF) CIM Infrastructure Specification (DSP004). This class is to be used for all CIMClass properties. NOTE: For instance properties, use the class CIMProperty.

Since:
JSR48 1.0.0
See Also:
Serialized Form

Constructor Summary
CIMClassProperty(java.lang.String pName, CIMDataType pType, java.lang.Object pValue, CIMQualifier[] pQualifiers, boolean pKey, boolean propagated, java.lang.String originClass)
          This method constructs an instance of CIMClassProperty.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this object against the specified object.
 CIMClassProperty filter(boolean includeQualifiers, boolean includeClassOrigin)
          Returns a CIMClassProperty filtered as specified.
 CIMQualifier getQualifier(int pIndex)
          Get a qualifier by index.
 CIMQualifier getQualifier(java.lang.String pName)
          Gets a qualifier by name.
 int getQualifierCount()
          Get the number of qualifiers defined for this property.
 CIMQualifier[] getQualifiers()
          Returns the list of qualifiers for this property.
 java.lang.Object getQualifierValue(java.lang.String name)
          Gets a qualifier value by name.
 boolean hasQualifier(java.lang.String pName)
          Checks whether the specified qualifier is one of the qualifiers defined for this property.
 boolean hasQualifierValue(java.lang.String name, java.lang.Object value)
          Checks whether the specified qualifier is one of the qualifiers defined for this property with the specified value.
 
Methods inherited from class javax.cim.CIMProperty
compareTo, getDataType, getOriginClass, getValue, isKey, isPropagated, toString
 
Methods inherited from class javax.cim.CIMElement
getName, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CIMClassProperty

public CIMClassProperty(java.lang.String pName,
                        CIMDataType pType,
                        java.lang.Object pValue,
                        CIMQualifier[] pQualifiers,
                        boolean pKey,
                        boolean propagated,
                        java.lang.String originClass)
This method constructs an instance of CIMClassProperty.

Parameters:
pName - The name of the property.
pType - The data type of the property.
pValue - The value of the property.
pQualifiers - The qualifiers for the property.
pKey - true if the property is a key, otherwise false.
propagated - true if the property was inherited, otherwise false.
originClass - The original class in which the property was defined.
Throws:
java.lang.IllegalArgumentException - Thrown if the property data type and value do not match.
Method Detail

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 CIMClassProperty that represents the same name, type and value as this object. Note: equals ignores the qualifiers when comparing the objects

Overrides:
equals in class CIMProperty
Parameters:
obj - - the object to compare with.
Returns:
true if the objects are the same; false otherwise.

filter

public CIMClassProperty filter(boolean includeQualifiers,
                               boolean includeClassOrigin)
Returns a CIMClassProperty filtered as specified.

Parameters:
includeQualifiers - If true all qualifiers are returned; otherwise no qualifiers.
includeClassOrigin - If true the class origin is included; otherwise no class origin is present
Returns:
CIMClassProperty A filtered CIMClassProperty

getQualifier

public CIMQualifier getQualifier(int pIndex)
Get a qualifier by index.

Specified by:
getQualifier in interface CIMQualifiedElementInterface
Parameters:
pIndex - The index of the qualifier to retrieve
Returns:
The Qualifier at the specified index.

getQualifier

public CIMQualifier getQualifier(java.lang.String pName)
Gets a qualifier by name.

Specified by:
getQualifier in interface CIMQualifiedElementInterface
Parameters:
pName - The name of the qualifier to get.
Returns:
CIMQualifier The qualifier requested or null if the qualifier does not exist.

getQualifierCount

public int getQualifierCount()
Get the number of qualifiers defined for this property.

Specified by:
getQualifierCount in interface CIMQualifiedElementInterface
Returns:
int The number of qualifiers defined for this property.

getQualifiers

public CIMQualifier[] getQualifiers()
Returns the list of qualifiers for this property.

Specified by:
getQualifiers in interface CIMQualifiedElementInterface
Returns:
CIMQualifier[] Qualifiers for this property.

getQualifierValue

public java.lang.Object getQualifierValue(java.lang.String name)
Gets a qualifier value by name.

Specified by:
getQualifierValue in interface CIMQualifiedElementInterface
Parameters:
name - The name of the qualifier to get.
Returns:
Null if the qualifier does not exist or value is null, otherwise returns the reference to the qualifier.

hasQualifier

public boolean hasQualifier(java.lang.String pName)
Checks whether the specified qualifier is one of the qualifiers defined for this property.

Specified by:
hasQualifier in interface CIMQualifiedElementInterface
Parameters:
pName - the name of the qualifier
Returns:
True if the qualifier exists in this property, otherwise false.

hasQualifierValue

public boolean hasQualifierValue(java.lang.String name,
                                 java.lang.Object value)
Checks whether the specified qualifier is one of the qualifiers defined for this property with the specified value. This method will return false if the qualifier is not applied or if the value does not match

Specified by:
hasQualifierValue in interface CIMQualifiedElementInterface
Parameters:
name - the name of the qualifier
value - the value to be tested
Returns:
True if the qualifier exists in this property, otherwise false.


Java™ WBEM (JSR48) 1.0.0 API