javax.management
public class MBeanAttributeInfo extends MBeanFeatureInfo implements Cloneable
description, name
Constructor and Description |
---|
MBeanAttributeInfo(String name,
String desc,
Method getter,
Method setter)
Constructs a new
MBeanAttributeInfo using the specified
name and description, with the given accessor and mutator
methods. |
MBeanAttributeInfo(String name,
String type,
String desc,
boolean isReadable,
boolean isWritable,
boolean isIs)
Constructs a new
MBeanAttributeInfo using the specified
name, description and type with the given settings for the accessor
and mutator methods. |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a clone of this instance.
|
boolean |
equals(Object obj)
Compares this feature with the supplied object.
|
String |
getType()
Returns the type of this attribute, in the form of its class name.
|
int |
hashCode()
Returns the hashcode of the attribute information as the sum of
the hashcode of the superclass, the hashcode of the type,
the hashcode of
isReadable() , twice the hashcode
of isWritable() and four times the hashcode
of isIs() . |
boolean |
isIs()
Returns true if the accessor method of this attribute
is of the form
isXXX . |
boolean |
isReadable()
Returns true if value of this attribute can be read.
|
boolean |
isWritable()
Returns true if the value of this attribute can be changed.
|
String |
toString()
Returns a textual representation of this instance.
|
getDescription, getName
public MBeanAttributeInfo(String name, String desc, Method getter, Method setter) throws IntrospectionException
MBeanAttributeInfo
using the specified
name and description, with the given accessor and mutator
methods. A null
value for the accessor method
indicates that the value can not be read. A null
value for the mutator method indicates that the value can not be
changed.name
- the name of the attribute.desc
- a description of the attribute.getter
- the accessor method, or null
if the value
can not be read.setter
- the mutator method, or null
if the value
can not be changed.IntrospectionException
- if both the accessor and mutator method
are null
.public MBeanAttributeInfo(String name, String type, String desc, boolean isReadable, boolean isWritable, boolean isIs)
MBeanAttributeInfo
using the specified
name, description and type with the given settings for the accessor
and mutator methods.name
- the name of the attribute.type
- the type of the attribute, in the form of its class name.desc
- a description of the attribute.isReadable
- true if the attribute's value can be read.isWritable
- true if the attribute's value can be changed.isIs
- true if the attribute uses an accessor of the form isXXX.IllegalArgumentException
- if the attribute is both unreadable
and unwritable.public Object clone()
Object
.
Thus, the clone is just a shallow clone as returned by
that method, and does not contain any deeper cloning based
on the subject of this class.public boolean equals(Object obj)
MBeanAttributeInfo
, Object#equals()
returns true for a comparison of both the name and
description of this attribute with that of the specified
object (performed by the superclass), and the type and
boolean flags of the two instances are equal.equals
in class MBeanFeatureInfo
obj
- the object to compare.MBeanAttributeInfo
instance,
name.equals(object.getName())
,
description.equals(object.getDescription())
,
attributeType.equals(object.getType())
,
isRead == object.isReadable()
,
isWrite == object.isWritable()
,
is == object.isIs()
Object.hashCode()
public String getType()
public int hashCode()
isReadable()
, twice the hashcode
of isWritable()
and four times the hashcode
of isIs()
.hashCode
in class MBeanFeatureInfo
Object.equals(Object)
,
System.identityHashCode(Object)
public boolean isIs()
isXXX
.isXXX
.public boolean isReadable()
public boolean isWritable()
public String toString()
Returns a textual representation of this instance. This
is constructed using the class name
(javax.management.MBeanAttributeInfo
),
the name, description and type of the attribute and the
current settings of the isReadable()
,
isWritable()
and isIs()
properties.
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 MBeanFeatureInfo
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)