javax.cim
Class CIMClassProperty<E>

java.lang.Object
  extended by javax.cim.CIMElement
      extended by javax.cim.CIMTypedElement
          extended by javax.cim.CIMValuedElement<E>
              extended by javax.cim.CIMProperty<E>
                  extended by javax.cim.CIMClassProperty<E>
Type Parameters:
E - : Type Parameter
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<CIMElement>, CIMQualifiedElementInterface

public class CIMClassProperty<E>
extends CIMProperty<E>
implements CIMQualifiedElementInterface

Creates and instantiates a CIM property, a name/value pair used to characterize instances of a class. Use this API to create a new attribute to describe managed objects. For example, after a printer upgrade to handle duplex (two-sided) printing, you could use this interface to create a CIM property called duplex. The CIMProperty class inherits the property name from its parent class ( CIMProperty extends CIMQualifiedElement). A CIM Property is defined by its name, data type and origin class.

See Also:
Serialized Form

Constructor Summary
CIMClassProperty(java.lang.String pName, CIMDataType pType, E 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 pObj)
          Compares this object against the specified object.
 CIMClassProperty<E> filter(boolean pIncludeQualifiers, boolean pIncludeClassOrigin)
          Returns a CIMClassProperty filtered as specified.
 CIMClassProperty<E> filter(boolean pIncludeQualifiers, boolean pIncludeClassOrigin, boolean pLocalOnly)
          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 pName)
          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 pName, java.lang.Object pValue)
          Checks whether the specified qualifier is one of the qualifiers defined for this property with the specified value.
 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.CIMProperty
getOriginClass, isKey, isPropagated
 
Methods inherited from class javax.cim.CIMValuedElement
getValue
 
Methods inherited from class javax.cim.CIMTypedElement
getDataType
 
Methods inherited from class javax.cim.CIMElement
compareTo, getName, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CIMClassProperty

public CIMClassProperty(java.lang.String pName,
                        CIMDataType pType,
                        E 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.
Method Detail

equals

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

Overrides:
equals in class CIMProperty<E>
Parameters:
pObj - - the object to compare with.
Returns:
true if the objects are the same; false otherwise.
See Also:
CIMProperty.equals(java.lang.Object)

filter

public CIMClassProperty<E> filter(boolean pIncludeQualifiers,
                                  boolean pIncludeClassOrigin)
Returns a CIMClassProperty filtered as specified.

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

filter

public CIMClassProperty<E> filter(boolean pIncludeQualifiers,
                                  boolean pIncludeClassOrigin,
                                  boolean pLocalOnly)
Returns a CIMClassProperty filtered as specified.

Parameters:
pIncludeQualifiers - If true all qualifiers are returned; otherwise no qualifiers.
pIncludeClassOrigin - If true the class origin is included; otherwise no class origin is present
pLocalOnly - If true only the qualifiers that were not propagated will be included.
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:
The qualifier requested or null if the qualifier does not exist.

getQualifierValue

public java.lang.Object getQualifierValue(java.lang.String pName)
Description copied from interface: CIMQualifiedElementInterface
Gets a qualifier value by name.

Specified by:
getQualifierValue in interface CIMQualifiedElementInterface
Parameters:
pName - - 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.
See Also:
CIMQualifiedElementInterface.getQualifierValue(java.lang.String)

getQualifierCount

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

Specified by:
getQualifierCount in interface CIMQualifiedElementInterface
Returns:
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:
Qualifiers for this property.

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 pName,
                                 java.lang.Object pValue)
Description copied from interface: CIMQualifiedElementInterface
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:
pName - - the name of the qualifier
pValue - - the value to be tested
Returns:
true if the qualifier exists and has the value, otherwise false.
See Also:
CIMQualifiedElementInterface.hasQualifierValue(java.lang.String, java.lang.Object)

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 CIMProperty<E>
Returns:
string representation of this element.
See Also:
CIMTypedElement.toString()


Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.