javax.cim
Class CIMMethod<E>

java.lang.Object
  extended by javax.cim.CIMElement
      extended by javax.cim.CIMMethod<E>
All Implemented Interfaces:
Serializable, Comparable<CIMElement>, CIMQualifiedElementInterface

public class CIMMethod<E>
extends CIMElement
implements CIMQualifiedElementInterface, Serializable

This class represents a CIM Method as defined by the Distributed Management Task Force (DMTF) CIM Infrastructure Specification (DSP004).

Since:
JSR48 1.0.0
See Also:
Serialized Form

Constructor Summary
CIMMethod(String name, CIMDataType type, CIMQualifier<?>[] qualifiers, CIMParameter<?>[] parameters, boolean propagated, String originClass)
          Constructs a CIMMethod object with the specified information.
 
Method Summary
 boolean equals(Object o)
          Compares this object against the specified object.
 CIMMethod<E> filter(boolean includeQualifiers, boolean includeClassOrigin)
          Returns a CIMMethod filtered as specified.
 CIMMethod<E> filter(boolean includeQualifiers, boolean includeClassOrigin, boolean localOnly)
          Returns a CIMMethod filtered as specified.
 CIMDataType getDataType()
          Returns the CIMDataType for this CIM Element.
 String getOriginClass()
          Returns the class name in which this method was defined or overridden.
 CIMParameter<?> getParameter(String pName)
          Get the parameter that matches the specified name.
 CIMParameter<?>[] getParameters()
          Returns an array of the parameters for this method
 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 name)
          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 name, Object value)
          Checks whether the specified qualifier is one of the qualifiers defined for this method with the specified value.
 boolean isPropagated()
          Determines if this method is Propagated.
 String toString()
          Returns a String representation of the CIMMethod.
 
Methods inherited from class javax.cim.CIMElement
compareTo, getName, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CIMMethod

public CIMMethod(String name,
                 CIMDataType type,
                 CIMQualifier<?>[] qualifiers,
                 CIMParameter<?>[] parameters,
                 boolean propagated,
                 String originClass)
Constructs a CIMMethod object with the specified information.

Parameters:
name - The name of the method.
type - The data type of the method.
qualifiers - The method qualifiers.
parameters - The array of parameters for this method.
propagated - Is this method propagated from the superclass.
originClass - The class this method was defined or overridden in.
Method Detail

equals

public boolean equals(Object o)
Compares this object against the specified object. The result is true if and only if the argument is not null and is an UnsignedInteger8 object that represents the same value as this object.

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

filter

public CIMMethod<E> filter(boolean includeQualifiers,
                           boolean includeClassOrigin)
Returns a CIMMethod 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:
CIMMethod A filtered CIMMethod

filter

public CIMMethod<E> filter(boolean includeQualifiers,
                           boolean includeClassOrigin,
                           boolean localOnly)
Returns a CIMMethod 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
localOnly - If true only the qualifiers defined on this class are included; otherwise all qualifiers are included.
Returns:
CIMMethod A filtered CIMMethod

getOriginClass

public String getOriginClass()
Returns the class name in which this method was defined or overridden.

Returns:
String Name of class where this property was defined.

getParameter

public CIMParameter<?> getParameter(String pName)
Get the parameter that matches the specified name.

Parameters:
pName - The name of the CIMParameter to retrieve
Returns:
CIMParameter matching the name specified; otherwise null

getParameters

public CIMParameter<?>[] getParameters()
Returns an array of the parameters for this method

Returns:
CIMParameter[] The parameters for this method

getQualifier

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

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

getQualifier

public CIMQualifier<?> getQualifier(String pName)
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.

getQualifierCount

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

Specified by:
getQualifierCount in interface CIMQualifiedElementInterface
Returns:
int The number of qualifiers.

getQualifiers

public CIMQualifier<?>[] getQualifiers()
Returns the list of qualifiers for this class

Specified by:
getQualifiers in interface CIMQualifiedElementInterface
Returns:
CIMQualifier[] qualifiers for this class

getQualifierValue

public Object getQualifierValue(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(String pName)
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.

hasQualifierValue

public boolean hasQualifierValue(String name,
                                 Object value)
Checks whether the specified qualifier is one of the qualifiers defined for this method 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 and has this value, otherwise false.

isPropagated

public boolean isPropagated()
Determines if this method is Propagated.

Returns:
true if this property is propagated.

toString

public String toString()
Returns a String representation of the CIMMethod. 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:
the string representation of this method

getDataType

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

Returns:
CIMDataType of this CIM element.


Copyright © 2002-2008 WBEM Solutions, Inc. All Rights Reserved.