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

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.management.openmbean.OpenType
ALLOWED_CLASSNAMES
 
Constructor Summary
CompositeType(java.lang.String typeName, java.lang.String description, java.lang.String[] itemNames, java.lang.String[] itemDescriptions, javax.management.openmbean.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
 javax.management.openmbean.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 javax.management.openmbean.OpenType
getClassName, getDescription, getTypeName, isArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeType

public CompositeType(java.lang.String typeName,
                     java.lang.String description,
                     java.lang.String[] itemNames,
                     java.lang.String[] itemDescriptions,
                     javax.management.openmbean.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).

Method Detail

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 javax.management.openmbean.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.

Specified by:
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

Specified by:
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()
Specified by:
hashCode in class OpenType
Returns:
the calculated hashcode

toString

public java.lang.String toString()
Specified by:
toString in class OpenType
Returns:
human readable representation of this class