|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.openmbean.OpenType<CompositeData>
javax.management.openmbean.CompositeType
public class CompositeType
The open type descriptor for instances of the
CompositeData
class.
Field Summary |
---|
Fields inherited from class javax.management.openmbean.OpenType |
---|
ALLOWED_CLASSNAMES, ALLOWED_CLASSNAMES_LIST |
Constructor Summary | |
---|---|
CompositeType(String name,
String desc,
String[] names,
String[] descs,
OpenType<?>[] types)
Constructs a new CompositeType instance for the given
type name with the specified field names, descriptions and types. |
Method Summary | |
---|---|
boolean |
containsKey(String name)
Returns true if this composite data type has a field with the given name. |
boolean |
equals(Object obj)
Compares this composite data type with another object for equality. |
String |
getDescription(String name)
Returns the description for the given field name, or null if the field name does not
exist within this composite data type. |
OpenType<?> |
getType(String name)
Returns the type for the given field name, or null if the field name does not
exist within this composite data type. |
int |
hashCode()
Returns the hash code of the composite data type. |
boolean |
isValue(Object obj)
Returns true if the specified object is a member of this composite type. |
Set<String> |
keySet()
Returns an unmodifiable Set -based
view of the field names that form part of this
CompositeType instance. |
String |
toString()
Returns a textual representation of this instance. |
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 |
---|
public CompositeType(String name, String desc, String[] names, String[] descs, OpenType<?>[] types) throws OpenDataException
Constructs a new CompositeType
instance for the given
type name with the specified field names, descriptions and types.
All parameters, and the elements of the array parameters, must be
non-null and String
values must be something other
than the empty string. The arrays must be non-empty, and be of
equal size.
The result of CompositeData.class.getName()
is adopted
as the class name (see OpenType
) and changes to the array
elements following construction of the CompositeType
instance
will not affect the values used by the instance.
The field names are sorted in to ascending alphanumeric order internally,
and so ordering can not be used to differentiate between two instances.
name
- the name of this composite type.desc
- a description of this composite type.names
- the names of each field within the composite type.descs
- the descriptions of each field within the composite type.types
- the types of each field within the composite type.
IllegalArgumentException
- if any validity constraint listed above
is broken.
OpenDataException
- if duplicate item names are provided. Item names
are case-sensitive, but whitespace is removed
before comparison.Method Detail |
---|
public boolean containsKey(String name)
name
- the name of the field to check for.
public boolean equals(Object obj)
Compares this composite data type with another object for equality. The objects are judged to be equal if:
obj
is not null.obj
is an instance of
CompositeType
.
equals
in class OpenType<CompositeData>
obj
- the object to compare with.
Object.hashCode()
public String getDescription(String name)
null
if the field name does not
exist within this composite data type.
name
- the name of the field whose description
should be returned.
null
if the
field doesn't exist.public OpenType<?> getType(String name)
null
if the field name does not
exist within this composite data type.
name
- the name of the field whose type
should be returned.
null
if the
field doesn't exist.public int hashCode()
Returns the hash code of the composite data type.
This is computed as the sum of the hash codes of
each field name and its type, together with the hash
code of the type name. These are the same elements
of the type that are compared as part of the
equals(java.lang.Object)
method, thus ensuring
that the hashcode is compatible with the equality
test.
As instances of this class are immutable, the hash code is computed just once for each instance and reused throughout its life.
hashCode
in class OpenType<CompositeData>
Object.equals(Object)
,
System.identityHashCode(Object)
public boolean isValue(Object obj)
CompositeData
with an equivalent
type, according to the definition of
equals(java.lang.Object)
for CompositeType
.
isValue
in class OpenType<CompositeData>
obj
- the object to test for membership.
public Set<String> keySet()
Set
-based
view of the field names that form part of this
CompositeType
instance. The names are stored
in ascending alphanumeric order.
String
s.public String toString()
Returns a textual representation of this instance. This
is constructed using the class name
(javax.management.openmbean.CompositeType
)
and each element of the instance which is relevant to
the definition of equals(java.lang.Object)
and
hashCode()
(i.e. the type name, and the name
and type of each field).
As instances of this class are immutable, the return value is computed just once for each instance and reused throughout its life.
toString
in class OpenType<CompositeData>
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |