JavaTM Platform
Standard Ed. 6

javax.management
类 Attribute

java.lang.Object
  继承者 javax.management.Attribute
所有已实现的接口:
Serializable

public class Attribute
extends Object
implements Serializable

通过将 MBean 属性名与其值相关联来表示 MBean 属性。MBean 服务器和其他对象使用此类来获得并设置属性值。

从以下版本开始:
1.5
另请参见:
序列化表格

构造方法摘要
Attribute(String name, Object value)
          构造将给定的属性名与给定值相关联的 Attribute 对象。
 
方法摘要
 boolean equals(Object object)
          比较当前的 Attribute Object 与另一个 Attribute Object。
 String getName()
          返回包含该 Attribute 的名称的 String。
 Object getValue()
          返回此 Attribute 值的 Object。
 int hashCode()
          返回此属性的哈希码值。
 String toString()
          返回一个表示此 Attribute 值 String 对象。
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

Attribute

public Attribute(String name,
                 Object value)
构造将给定的属性名与给定值相关联的 Attribute 对象。

参数:
name - 一个 String,包含要创建的属性的名称。不可以为 null。
value - 分配给属性的 Object。此对象必须与该属性的类型相同。
方法详细信息

getName

public String getName()
返回包含该 Attribute 的名称的 String。

返回:
Attribute 的名称。

getValue

public Object getValue()
返回此 Attribute 值的 Object。

返回:
Attribute 的值。

equals

public boolean equals(Object object)
比较当前的 Attribute Object 与另一个 Attribute Object。

覆盖:
Object 中的 equals
参数:
object - 要与当前 Attribute 进行比较的 Attribute。
返回:
如果两个 Attribute 对象相等,则返回 true;否则返回 false。
另请参见:
Object.hashCode(), Hashtable

hashCode

public int hashCode()
返回此属性的哈希码值。

覆盖:
Object 中的 hashCode
返回:
此属性的哈希码值。
另请参见:
Object.equals(java.lang.Object), Hashtable

toString

public String toString()
返回一个表示此 Attribute 值 String 对象。此字符串的格式是未指定的,但当且仅当两个 Attributes 相等时,才返回相同的字符串。

覆盖:
Object 中的 toString
返回:
该对象的字符串表示形式。

JavaTM Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策