javax.management.openmbean
Class CompositeType
java.lang.Object
|
+--javax.management.openmbean.OpenType
|
+--javax.management.openmbean.CompositeType
- All Implemented Interfaces:
- java.io.Serializable
- public class CompositeType
- extends OpenType
- implements java.io.Serializable
- Version:
- $Revision: 1.4 $
- Author:
- Bronwen Cassidy
- See Also:
- Serialized Form
Constructor Summary |
CompositeType(java.lang.String typeName,
java.lang.String description,
java.lang.String[] itemNames,
java.lang.String[] itemDescriptions,
OpenType[] itemTypes)
The CompositeType class is the open type class whose instances describe the types of CompositeData values
The Java class name of composite data values this composite type represents (ie the class name returned by
the getClassName method) is set to the string value returned by CompositeData.class.getName().
|
Method Summary |
boolean |
containsKey(java.lang.String itemName)
check if the key itemName is present |
boolean |
equals(java.lang.Object object)
tests object passed in is equal to the CompositeType instance |
java.lang.String |
getDescription(java.lang.String itemName)
Retrieve the description value for the given key |
OpenType |
getType(java.lang.String itemName)
Retrieve the OpenType for the given key |
int |
hashCode()
|
boolean |
isValue(java.lang.Object object)
Test whether object is a value which could be described by this CompositeType instance. |
java.util.Set |
keySet()
Retrieve an unmodifiable set of keys |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
CompositeType
public CompositeType(java.lang.String typeName,
java.lang.String description,
java.lang.String[] itemNames,
java.lang.String[] itemDescriptions,
OpenType[] itemTypes)
throws OpenDataException
- The CompositeType class is the open type class whose instances describe the types of CompositeData values
The Java class name of composite data values this composite type represents (ie the class name returned by
the getClassName method) is set to the string value returned by CompositeData.class.getName().
Parameters:<
typeName - The name given to the composite type this instance represents; cannot be a null or empty string
description - The human readable description of the composite type this instance represents; cannot be a null or empty string
itemNames - The n/b>ames of the items contained in the composite data values described by this composite type instance, cannot be null, and should contain at
least one element, no element can be null, or an empty string.
NOTE: the order in which the item names are given is not important to differentiate one CompositeType from another. The item names are stored internally sorted in
ascending alphanumeric order
itemDescriptions - the descriptions in the same order as the itemNames, same size as itemNames, with no item null or an empty String.
itemTypes - The openType instances, in the same order as itemNames, describing the items contained in the compositeData values described by this instance.
Should be the same size as itemNames and no element can be null.
Throws:
IllegalArgumentException - If typeName or description is a null or empty string, or itemNames or itemDescriptions or itemTypes is null, or any element of
itemNames or itemDescriptions is a null or empty string, or any element of itemTypes is null, or itemNames or itemDescriptions or itemTypes are not of the same size.
OpenDataException - If itemNames contains duplicate item names (case sensitive, but leading and trailing whitespaces removed).
containsKey
public boolean containsKey(java.lang.String itemName)
- check if the key itemName is present
- Parameters:
itemName
- the name of the key to look for- Returns:
- true if the key is present, false otherwise
getDescription
public java.lang.String getDescription(java.lang.String itemName)
- Retrieve the description value for the given key
- Parameters:
itemName
- the key- Returns:
- the corresponding value
getType
public OpenType getType(java.lang.String itemName)
- Retrieve the OpenType for the given key
- Parameters:
itemName
- the key for which to fetch the openType value- Returns:
- OpenType or null if there is no value for the given key, or no matching key
keySet
public java.util.Set keySet()
- Retrieve an unmodifiable set of keys
- Returns:
- a Set of the keys
isValue
public boolean isValue(java.lang.Object object)
- Test whether object is a value which could be described by this CompositeType instance.
- Overrides:
isValue
in class OpenType
- Parameters:
object
- the Object to test if is a value which can be described by this CompositeType instance- Returns:
- true if object is a value which can be described by this CompositeType instance, false otherwise.
equals
public boolean equals(java.lang.Object object)
- tests object passed in is equal to the CompositeType instance
- Overrides:
equals
in class OpenType
- Parameters:
object
- the Object to test if it is equal to this CompositeType instance- Returns:
- true if the objects are equal as tested by taking the most significant fields and testing they are equal
hashCode
public int hashCode()
- Overrides:
hashCode
in class OpenType
- Returns:
- the calculated hashcode
toString
public java.lang.String toString()
- Overrides:
toString
in class OpenType
- Returns:
- human readable representation of this class
Copyright © 2001-2002 MX4J Team. All Rights Reserved.