Package javax.cim
Class CIMClassProperty<E>
- java.lang.Object
-
- javax.cim.CIMElement
-
- javax.cim.CIMTypedElement
-
- javax.cim.CIMValuedElement<E>
-
- javax.cim.CIMProperty<E>
-
- 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
This class represents a CIM property (when used for aCIMClass
) as defined by the Distributed Management Task Force (DMTF) CIM Infrastructure Specification (DSP004). This class is to be used for allCIMClass
properties. NOTE: For instance properties, use the classCIMProperty
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CIMClassProperty(java.lang.String pName, CIMDataType pType, E pValue, CIMQualifier<?>[] pQualifiers, boolean pKey, boolean pPropagated, java.lang.String pOriginClass)
This method constructs an instance ofCIMClassProperty
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object pObj)
Compares this object against the specified object.CIMClassProperty<E>
filter(boolean pIncludeQualifiers, boolean pIncludeClassOrigin)
Returns aCIMClassProperty
filtered as specified.CIMClassProperty<E>
filter(boolean pIncludeQualifiers, boolean pIncludeClassOrigin, boolean pLocalOnly)
Returns aCIMClassProperty
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.-
Methods inherited from class javax.cim.CIMProperty
getOriginClass, isKey, isPropagated
-
Methods inherited from class javax.cim.CIMValuedElement
getValue, hashCode, toString
-
Methods inherited from class javax.cim.CIMTypedElement
getDataType
-
Methods inherited from class javax.cim.CIMElement
compareTo, getName
-
-
-
-
Constructor Detail
-
CIMClassProperty
public CIMClassProperty(java.lang.String pName, CIMDataType pType, E pValue, CIMQualifier<?>[] pQualifiers, boolean pKey, boolean pPropagated, java.lang.String pOriginClass)
This method constructs an instance ofCIMClassProperty
.- 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, otherwisefalse
.pPropagated
-true
if the property was inherited, otherwisefalse
.pOriginClass
- The original class in which the property was defined.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object pObj)
Compares this object against the specified object. The result istrue
if and only if the argument is not null and is aCIMClassProperty
that represents the same name, type and value as this object.- Overrides:
equals
in classCIMProperty<E>
- Parameters:
pObj
- The object to compare with.- Returns:
true
if the objects are the same;false
otherwise.
-
filter
public CIMClassProperty<E> filter(boolean pIncludeQualifiers, boolean pIncludeClassOrigin)
Returns aCIMClassProperty
filtered as specified.- Parameters:
pIncludeQualifiers
- Iftrue
all qualifiers are returned; otherwise no qualifiers.pIncludeClassOrigin
- Iftrue
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 aCIMClassProperty
filtered as specified.- Parameters:
pIncludeQualifiers
- Iftrue
all qualifiers are returned; otherwise no qualifiers.pIncludeClassOrigin
- Iftrue
the class origin is included; otherwise no class origin is present.pLocalOnly
- Iftrue
only the qualifiers that were not propagated will be included.- Returns:
- CIMClassProperty A filtered
CIMClassProperty
.
-
getQualifier
public CIMQualifier<?> getQualifier(int pIndex) throws java.lang.ArrayIndexOutOfBoundsException
Get a qualifier by index.- Specified by:
getQualifier
in interfaceCIMQualifiedElementInterface
- Parameters:
pIndex
- The index of the qualifier to retrieve.- Returns:
- The qualifier at the specified index.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
getQualifier
public CIMQualifier<?> getQualifier(java.lang.String pName)
Gets a qualifier by name.- Specified by:
getQualifier
in interfaceCIMQualifiedElementInterface
- Parameters:
pName
- The name of the qualifier to get.- Returns:
- 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 interfaceCIMQualifiedElementInterface
- 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 interfaceCIMQualifiedElementInterface
- Returns:
- Qualifiers for this property.
-
getQualifierValue
public java.lang.Object getQualifierValue(java.lang.String pName)
Gets a qualifier value by name.- Specified by:
getQualifierValue
in interfaceCIMQualifiedElementInterface
- Parameters:
pName
- The name of the qualifier to get.- Returns:
null
if the qualifier does not exist or value isnull
, 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 interfaceCIMQualifiedElementInterface
- Parameters:
pName
- The name of the qualifier.- Returns:
true
if the qualifier exists in this property, otherwisefalse
.
-
hasQualifierValue
public 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. This method will returnfalse
if the qualifier is not applied or if the value does not match.- Specified by:
hasQualifierValue
in interfaceCIMQualifiedElementInterface
- Parameters:
pName
- The name of the qualifier.pValue
- The value to be tested.- Returns:
true
if the qualifier exists in this property, otherwisefalse
.
-
-