public class MBeanAttributeInfo extends MBeanFeatureInfo implements Cloneable
description, name| Constructor and Description |
|---|
MBeanAttributeInfo(String name, String description, 方法 getter, 方法 setter)
此构造函数以一个简单的属性的名称,和用于读取和写入属性的方法对象。
|
MBeanAttributeInfo(String name, String type, String description, boolean isReadable, boolean isWritable, boolean isIs)
构建了一个
MBeanAttributeInfo对象。
|
MBeanAttributeInfo(String name, String type, String description, boolean isReadable, boolean isWritable, boolean isIs, Descriptor descriptor)
构建了一个
MBeanAttributeInfo对象。
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
返回此实例的浅克隆。
|
boolean |
equals(Object o)
比较这mbeanattributeinfo到另一个。
|
String |
getType()
返回属性的类名称。
|
int |
hashCode()
返回一个对象的哈希代码值。
|
boolean |
isIs()
表明如果这个属性有一个“是”的人。
|
boolean |
isReadable()
属性的值是否可以读取。
|
boolean |
isWritable()
是否可以将新的值写入属性。
|
String |
toString()
返回对象的字符串表示形式。
|
getDescription, getDescriptor, getNamepublic MBeanAttributeInfo(String name, String type, String description, boolean isReadable, boolean isWritable, boolean isIs)
MBeanAttributeInfo对象。
name -属性的名称。
type的类型或属性的类的名称。
description -人类的可读属性描述。
isReadable -如果属性的getter方法,否则为假。
isWritable -如果属性setter方法,否则为假。
isIs -如果这个属性有一个“是”吸气,否则为假。
IllegalArgumentException -如果
isIs是真的但
isReadable不是,或者如果
isIs真实
type不
boolean或
java.lang.Boolean。(新代码应该总是使用
boolean而不是
java.lang.Boolean。)
public MBeanAttributeInfo(String name, String type, String description, boolean isReadable, boolean isWritable, boolean isIs, Descriptor descriptor)
MBeanAttributeInfo对象。
name -属性的名称。
type的类型或属性的类的名称。
description -人类的可读属性描述。
isReadable -如果属性的getter方法,否则为假。
isWritable -如果属性setter方法,否则为假。
isIs -如果这个属性有一个“是”吸气,否则为假。
descriptor -属性描述符。这可能是空的,这相当于一个空的描述符。
IllegalArgumentException -如果
isIs是真的但
isReadable不是,或者如果
isIs真实
type不
boolean或
java.lang.Boolean。(新代码应该总是使用
boolean而不是
java.lang.Boolean。)
public MBeanAttributeInfo(String name, String description, 方法 getter, 方法 setter) throws IntrospectionException
此构造函数以一个简单的属性的名称,和用于读取和写入属性的方法对象。该构造的对象的字段Descriptor将包括了包含DescriptorKey元注释对象的方法任何注释。
name -属性的项目名称。
description -人类的可读属性描述。
getter用于读取属性值的方法。可能是无效的,如果属性是只写。
setter -用于写入属性值的方法。如果属性是只读的,则可能为空。
IntrospectionException -在这个属性定义的一致性问题。
public Object clone()
返回此实例的浅克隆。克隆是通过简单地调用super.clone()获得,从而调用默认本地浅克隆机制的实施Object.clone()。没有任何内部领域的更深的克隆。
由于这个类是不可变的,克隆主要是感兴趣的子类。
public String getType()
public boolean isReadable()
public boolean isWritable()
public boolean isIs()
public String toString()
Object
toString方法返回一个字符串,“以文本方式表示”这个对象。其结果应该是一个简洁,但翔实的代表性,是一个容易阅读的人。建议所有子类都重写此方法。
Object类的toString方法返回一个包含该类的对象是一个实例的名称字符串的符号` @ ',和符号进制表示的对象的哈希码。换句话说,此方法返回一个等于值的字符串:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public boolean equals(Object o)
equals 方法重写,继承类
MBeanFeatureInfo
o -对象比较。
o是mbeanattributeinfo,
MBeanFeatureInfo.getName(),
getType(),
MBeanFeatureInfo.getDescription(),
isReadable(),
isWritable()真实,和
isIs()值相等(不一定是相同的)的这mbeanattributeinfo。
Object.hashCode(),
HashMap
public int hashCode()
Object
HashMap利益支持。
对hashCode一般合同:
hashCode方法总是返回相同的整数,没有提供信息用于equals比较的对象被修改。这个整数不需要保持一致,从一个应用程序的一个执行到另一个执行相同的应用程序。equals(Object)法两个对象是相等的,那么调用hashCode方法每一个对象必须产生相同的整数结果。Object.equals(java.lang.Object)法两个对象是不平等的,然后调用hashCode方法每一个对象必须产生不同的整数结果。然而,程序员应该意识到,产生不同的整数结果的不平等的对象可能会提高哈希表的性能。尽合理的切实可行,由类Object定义hashCode方法返回不同的对象不同的整数。(这通常是通过将该对象的内部地址转换成一个整数,但这不是实现实现技术的™java编程语言。要求)
hashCode 方法重写,继承类
MBeanFeatureInfo
Object.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.