Class: javax.management.openmbean.CompositeType
- public class CompositeType
- extends OpenType<CompositeData>
CompositeType class is the open type class
whose instances describe the types of CompositeData values.Inheritance
Superclass tree:- java.lang.Object
- javax.management.openmbean.OpenType<javax.management.openmbean.CompositeData>
- javax.management.openmbean.CompositeType
Methods
-
CompositeTypetop
public CompositeType(String typeName, String description, String[] itemNames, String[] itemDescriptions, OpenType<?>[] itemTypes) throws OpenDataExceptionConstructs aCompositeTypeinstance, checking for the validity of the given parameters. The validity constraints are described below for each parameter.Note that the contents of the three array parameters itemNames, itemDescriptions and itemTypes are internally copied so that any subsequent modification of these arrays by the caller of this constructor has no impact on the constructed
CompositeTypeinstance.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(). -
checkForEmptyStringtop
-
checkForNullElementtop
-
containsKeytop
public boolean containsKey(String itemName)Returnstrueif thisCompositeTypeinstance defines an item whose name is itemName. -
equalstop
public boolean equals(Object obj)Compares the specifiedobjparameter with thisCompositeTypeinstance for equality.Two
CompositeTypeinstances are equal if and only if all of the following statements are true:- their type names are equal
- their items' names and types are equal
- Override hierarchy:
- equals from OpenType<CompositeData>
- equals from Object
-
getDescriptiontop
Returns the description of the item whose name is itemName, ornullif thisCompositeTypeinstance does not define any item whose name is itemName. -
getTypetop
Returns the open type of the item whose name is itemName, ornullif thisCompositeTypeinstance does not define any item whose name is itemName. -
hashCodetop
public int hashCode()Returns the hash code value for thisCompositeTypeinstance.The hash code of a
CompositeTypeinstance is the sum of the hash codes of all elements of information used inequalscomparisons (ie: name, items names, items types). This ensures thatt1.equals(t2)implies thatt1.hashCode()==t2.hashCode()for any twoCompositeTypeinstancest1andt2, as required by the general contract of the method Object.hashCode().As
CompositeTypeinstances are immutable, the hash code for this instance is calculated once, on the first call tohashCode, and then the same value is returned for subsequent calls.- Override hierarchy:
- hashCode from OpenType<CompositeData>
- hashCode from Object
-
isAssignableFromtop
Tests whether values of the given type can be assigned to this open type. The result is true if the given type is also a CompositeType with the same name (javax.management.openmbean.OpenType.getTypeName()), and every item in this type is also present in the given type with the same name and assignable type. There can be additional items in the given type, which are ignored.- Override hierarchy:
- isAssignableFrom from OpenType<CompositeData>
-
isValuetop
public boolean isValue(Object obj)Tests whether obj is a value which could be described by thisCompositeTypeinstance.If obj is null or is not an instance of
javax.management.openmbean.CompositeData,isValuereturnsfalse.If obj is an instance of
javax.management.openmbean.CompositeData, then let ct be its CompositeType as returned by javax.management.openmbean.CompositeData.getCompositeType(). The result is true if this is assignable from ct. This means that:- this.getTypeName() equals ct.getTypeName(), and
- there are no item names present in this that are not also present in ct, and
- for every item in this, its type is assignable from the type of the corresponding item in ct.
A TabularType is assignable from another TabularType if they have the same typeName and index name list, and the row type of the first is assignable from the row type of the second.
An ArrayType is assignable from another ArrayType if they have the same dimension; and both are primitive arrays or neither is; and the element type of the first is assignable from the element type of the second.
In every other case, an OpenType is assignable from another OpenType only if they are equal.
These rules mean that extra items can be added to a CompositeData without making it invalid for a CompositeType that does not have those items.
- Override hierarchy:
- isValue from OpenType<CompositeData>
-
keySettop
Returns an unmodifiable Set view of all the item names defined by thisCompositeTypeinstance. The set's iterator will return the item names in ascending order. -
toStringtop
public String toString()Returns a string representation of thisCompositeTypeinstance.The string representation consists of the name of this class (ie
javax.management.openmbean.CompositeType), the type name for this instance, and the list of the items names and types string representation of this instance.As
CompositeTypeinstances are immutable, the string representation for this instance is calculated once, on the first call totoString, and then the same value is returned for subsequent calls.- Override hierarchy:
- toString from OpenType<CompositeData>
- toString from Object
