javax.cim
Class CIMParameter<E>

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

public class CIMParameter<E>
extends CIMTypedElement
implements CIMQualifiedElementInterface

The CIMParameter class wraps a CIM parameter that is used to define an input, output or input/output parameter to a CIM method. A CIMParameter object consists of a name, data type and a list of qualifiers. NOTE: Parameters do not have values - so you can not set a default value. CIM Parameters are defined in the CIM Infrastructure Specification. The specification is available from the DMTF (Distributed Management Task Force) at http://dmtf.org/.

See Also:
CIMMethod, Serialized Form

Constructor Summary
CIMParameter(String pName, CIMDataType pType, CIMQualifier<?>[] pQualifiers)
          Constructs a CIMParameter object using the specified name, data type and qualifiers.
 
Method Summary
 boolean equals(Object pObj)
          Compares this object against the specified object.
 CIMParameter<E> filter(boolean pIncludeQualifiers, boolean pLocalOnly)
          Returns a CIMParameter filtered as specified.
 CIMQualifier<?> getQualifier(int pIndex)
          Get a qualifier by index.
 CIMQualifier<?> getQualifier(String pName)
          Gets a qualifier by name.
 int getQualifierCount()
          Get the number of qualifiers defined for this CIM Element.
 CIMQualifier<?>[] getQualifiers()
          Returns the list of qualifiers for this class.
 Object getQualifierValue(String pName)
          Gets a qualifier value by name.
 boolean hasQualifier(String pName)
          Checks whether the specified qualifier is one of the qualifiers in this CIM element.
 boolean hasQualifierValue(String pName, Object pValue)
          Checks whether the specified qualifier is one of the qualifiers defined for this property with the specified value.
 String toString()
          Returns a String representation of the CIMParameter.
 
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

CIMParameter

public CIMParameter(String pName,
                    CIMDataType pType,
                    CIMQualifier<?>[] pQualifiers)
Constructs a CIMParameter object using the specified name, data type and qualifiers. Takes a string for the name of an existing CIM parameter and creates a new instance of a CIM parameter, using the name and identifier of the existing CIM parameter.

Parameters:
pName - - name of this parameter
pType - - data type of this parameter
pQualifiers - - qualifiers for this parameter
Method Detail

equals

public boolean equals(Object pObj)
Description copied from class: CIMTypedElement
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 CIMTypedElement
Parameters:
pObj - - The object to compare with.
Returns:
true if the objects are the same; false otherwise.
See Also:
CIMTypedElement.equals(java.lang.Object)

filter

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

Parameters:
pIncludeQualifiers - If true all qualifiers are returned; otherwise no qualifiers.
pLocalOnly - If true only the qualifiers that were not propagated will be included.
Returns:
A filtered CIMParameter.

getQualifier

public CIMQualifier<?> getQualifier(int pIndex)
Description copied from interface: CIMQualifiedElementInterface
Get a qualifier by index.

Specified by:
getQualifier in interface CIMQualifiedElementInterface
Parameters:
pIndex - - The index of the qualifier.
Returns:
The Qualifier at index pIndex.
See Also:
CIMQualifiedElementInterface.getQualifier(int)

getQualifier

public CIMQualifier<?> getQualifier(String pName)
Description copied from interface: CIMQualifiedElementInterface
Gets a qualifier by name.

Specified by:
getQualifier in interface CIMQualifiedElementInterface
Parameters:
pName - - The name of the qualifier to get.
Returns:
null if the qualifier does not exist, otherwise returns the reference to the qualifier.
See Also:
CIMQualifiedElementInterface.getQualifier(java.lang.String)

getQualifierValue

public Object getQualifierValue(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()
Description copied from interface: CIMQualifiedElementInterface
Get the number of qualifiers defined for this CIM Element.

Specified by:
getQualifierCount in interface CIMQualifiedElementInterface
Returns:
The number of qualifiers.
See Also:
CIMQualifiedElementInterface.getQualifierCount()

getQualifiers

public CIMQualifier<?>[] getQualifiers()
Description copied from interface: CIMQualifiedElementInterface
Returns the list of qualifiers for this class.

Specified by:
getQualifiers in interface CIMQualifiedElementInterface
Returns:
Qualifiers for this class.
See Also:
CIMQualifiedElementInterface.getQualifiers()

hasQualifier

public boolean hasQualifier(String pName)
Description copied from interface: CIMQualifiedElementInterface
Checks whether the specified qualifier is one of the qualifiers in this CIM element.

Specified by:
hasQualifier in interface CIMQualifiedElementInterface
Parameters:
pName - - the name of the qualifier
Returns:
true if the qualifier exists in this CIM element, otherwise false.
See Also:
CIMQualifiedElementInterface.hasQualifier(java.lang.String)

hasQualifierValue

public boolean hasQualifierValue(String pName,
                                 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 String toString()
Returns a String representation of the CIMParameter. 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 CIMTypedElement
Returns:
string representation of this parameter
See Also:
CIMElement.toString()


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