Package javax.cim
Class CIMValuedElement<E>
- java.lang.Object
-
- javax.cim.CIMElement
-
- javax.cim.CIMTypedElement
-
- javax.cim.CIMValuedElement<E>
-
- Type Parameters:
E- Type parameter.
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CIMElement>
- Direct Known Subclasses:
CIMArgument,CIMProperty,CIMQualifier,CIMQualifierType
public abstract class CIMValuedElement<E> extends CIMTypedElement
CIMValuedElementis a base class used by any element that contains a name, type and value.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCIMValuedElement(java.lang.String pName, CIMDataType pType, E pValue)Creates a new CIM element with the given name, type and value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object pObj)Compares this object against the specified object.EgetValue()Returns the value for this CIM Element.inthashCode()Returns a hash code value for the CIM valued element.java.lang.StringtoString()Returns aStringrepresentation of the CIM Element.-
Methods inherited from class javax.cim.CIMTypedElement
getDataType
-
Methods inherited from class javax.cim.CIMElement
compareTo, getName
-
-
-
-
Constructor Detail
-
CIMValuedElement
protected CIMValuedElement(java.lang.String pName, CIMDataType pType, E pValue)Creates a new CIM element with the given name, type and value.- Parameters:
pName- The string for the name for this element.pType- The data type for this element.pValue- The value for this element.nullis a valid value.- Throws:
java.lang.IllegalArgumentException- If the value does not match the data type.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object pObj)
Compares this object against the specified object. The result istrueif and only if the argument is notnulland is aCIMValuedElementthat represents the same name, type and value as this object.- Overrides:
equalsin classCIMTypedElement- Parameters:
pObj- The object to compare with.- Returns:
trueif the objects are the same;falseotherwise.
-
getValue
public E getValue()
Returns the value for this CIM Element.- Returns:
- The value of the CIM Element.
nullis a valid value.
-
hashCode
public int hashCode()
Returns a hash code value for the CIM valued element. This method is supported for the benefit of hashtables such as those provided byjava.util.Hashtable.- Overrides:
hashCodein classCIMTypedElement- Returns:
- A hash code value for this CIM valued element.
-
toString
public java.lang.String toString()
Returns aStringrepresentation of the CIM Element. 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 benull.- Overrides:
toStringin classCIMTypedElement- Returns:
- String representation of this element.
-
-