APIdia Launch Partner
Top Description Fields Constructors Methods
javax.management

public Class ObjectInstance

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, javax.management.ObjectName

Used to represent the object name of an MBean and its class name. If the MBean is a Dynamic MBean the class name should be retrieved from the MBeanInfo it provides.
Since
1.5

Field Summary

Modifier and TypeField and Description
private String
private ObjectName
private static final long

Constructor Summary

AccessConstructor and Description
public
ObjectInstance(String
A string representation of the object name.
objectName
,
String
The full class name, including the package name, of the object instance. If the MBean is a Dynamic MBean the class name corresponds to its getMBeanInfo().getClassName().
className
)

Allows an object instance to be created given a string representation of an object name and the full class name, including the package name.

public
ObjectInstance(ObjectName
The object name.
objectName
,
String
The full class name, including the package name, of the object instance. If the MBean is a Dynamic MBean the class name corresponds to its getMBeanInfo().getClassName(). If the MBean is a Dynamic MBean the class name should be retrieved from the MBeanInfo it provides.
className
)

Allows an object instance to be created given an object name and the full class name, including the package name.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if the two object instances are equal, otherwise false.
equals
(Object
The object instance that the current object instance is to be compared with.
object
)

Overrides java.lang.Object.equals.

Compares the current object instance with another object instance.

public String

Returns:

the class name.
getClassName
()

Returns the class part.

public ObjectName

Returns:

the object name.
getObjectName
()

Returns the object name part.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representing this ObjectInstance object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

classNameback to summary
private String className
nameback to summary
private ObjectName name
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ObjectInstanceback to summary
public ObjectInstance(String objectName, String className) throws MalformedObjectNameException

Allows an object instance to be created given a string representation of an object name and the full class name, including the package name.

Parameters
objectName:String

A string representation of the object name.

className:String

The full class name, including the package name, of the object instance. If the MBean is a Dynamic MBean the class name corresponds to its getMBeanInfo().getClassName().

Exceptions
MalformedObjectNameException:
The string passed as a parameter does not have the right format.
ObjectInstanceback to summary
public ObjectInstance(ObjectName objectName, String className)

Allows an object instance to be created given an object name and the full class name, including the package name.

Parameters
objectName:ObjectName

The object name.

className:String

The full class name, including the package name, of the object instance. If the MBean is a Dynamic MBean the class name corresponds to its getMBeanInfo().getClassName(). If the MBean is a Dynamic MBean the class name should be retrieved from the MBeanInfo it provides.

Method Detail

equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Compares the current object instance with another object instance.

Parameters
object:Object

The object instance that the current object instance is to be compared with.

Returns:boolean

True if the two object instances are equal, otherwise false.

getClassNameback to summary
public String getClassName()

Returns the class part.

Returns:String

the class name.

getObjectNameback to summary
public ObjectName getObjectName()

Returns the object name part.

Returns:ObjectName

the object name.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representing this ObjectInstance object. The format of this string is not specified, but users can expect that two ObjectInstances return the same string if and only if they are equal.