javax.management

Class Attribute

public class Attribute extends Object implements Serializable

Represents an MBean attribute, having the name and the assigned value. The MBean objects use this class to get and set attributes values.

Since: 1.5

Constructor Summary
Attribute(String name, Object value)
Create the attribute with the given name and value.
Method Summary
booleanequals(Object other)
Compares the attribute with another attribute.
StringgetName()
Returns the attribute name.
ObjectgetValue()
Returns the attribute value.
inthashCode()
Need to override as {@link #equals} is overridden.

Constructor Detail

Attribute

public Attribute(String name, Object value)
Create the attribute with the given name and value.

Parameters: name the attribute name value the attribute value

Method Detail

equals

public boolean equals(Object other)
Compares the attribute with another attribute.

Parameters: other the other object to compare with

Returns: true if both value and object are equal, false otherwise.

getName

public String getName()
Returns the attribute name.

Returns: the attribute name

getValue

public Object getValue()
Returns the attribute value.

Returns: the attribute value.

hashCode

public int hashCode()
Need to override as {@link #equals} is overridden.

Returns: the expression, dependent of the object and name hashcodes.