javax.management.openmbean
Class SimpleTypejava.lang.Object javax.management.openmbean.OpenType javax.management.openmbean.SimpleType
- All Implemented Interfaces:
- Serializable
- public final class SimpleType
- extends OpenType
- implements Serializable
The
SimpleType
class is the open type class whose instances describe all open data values which are neither arrays, norCompositeData
values, norTabularData
values. It predefines all its possible instances as static fields, and has no public constructor.Given a
SimpleType
instance describing values whose Java class name is className, the internal fields corresponding to the name and description of thisSimpleType
instance are also set to className. In other words, its methodsgetClassName
,getTypeName
andgetDescription
all return the same string value className.
- Since:
- JMX 1.1
- Version:
- 3.13 02/10/01
- Author:
- Sun Microsystems, Inc.
- See Also:
- Serialized Form
Field Summary static SimpleType BIGDECIMAL
TheSimpleType
instance describing values whose Java class name isjava.math.BigDecimal
.static SimpleType BIGINTEGER
TheSimpleType
instance describing values whose Java class name isjava.math.BigInteger
.static SimpleType BOOLEAN
TheSimpleType
instance describing values whose Java class name isjava.lang.Boolean
.static SimpleType BYTE
TheSimpleType
instance describing values whose Java class name isjava.lang.Byte
.static SimpleType CHARACTER
TheSimpleType
instance describing values whose Java class name isjava.lang.Character
.static SimpleType DATE
TheSimpleType
instance describing values whose Java class name isjava.util.Date
.static SimpleType DOUBLE
TheSimpleType
instance describing values whose Java class name isjava.lang.Double
.static SimpleType FLOAT
TheSimpleType
instance describing values whose Java class name isjava.lang.Float
.static SimpleType INTEGER
TheSimpleType
instance describing values whose Java class name isjava.lang.Integer
.static SimpleType LONG
TheSimpleType
instance describing values whose Java class name isjava.lang.Long
.static SimpleType OBJECTNAME
TheSimpleType
instance describing values whose Java class name isjavax.management.ObjectName
.static SimpleType SHORT
TheSimpleType
instance describing values whose Java class name isjava.lang.Short
.static SimpleType STRING
TheSimpleType
instance describing values whose Java class name isjava.lang.String
.static SimpleType VOID
TheSimpleType
instance describing values whose Java class name isjava.lang.Void
.
Fields inherited from class javax.management.openmbean.OpenType ALLOWED_CLASSNAMES
Method Summary boolean equals(Object obj)
Compares the specifiedobj
parameter with thisSimpleType
instance for equality.int hashCode()
Returns the hash code value for thisSimpleType
instance.boolean isValue(Object obj)
Tests whether obj is a value for thisSimpleType
instance.Object readResolve()
Replace an object read from an ObjectInputStream with the unique instance for that value.String toString()
Returns a string representation of thisSimpleType
instance.
Methods inherited from class javax.management.openmbean.OpenType getClassName, getDescription, getTypeName, isArray
Methods inherited from class java.lang.Object clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Field Detail VOID
public static final SimpleType VOID
- The
SimpleType
instance describing values whose Java class name isjava.lang.Void
.
BOOLEAN
public static final SimpleType BOOLEAN
- The
SimpleType
instance describing values whose Java class name isjava.lang.Boolean
.
CHARACTER
public static final SimpleType CHARACTER
- The
SimpleType
instance describing values whose Java class name isjava.lang.Character
.
BYTE
public static final SimpleType BYTE
- The
SimpleType
instance describing values whose Java class name isjava.lang.Byte
.
SHORT
public static final SimpleType SHORT
- The
SimpleType
instance describing values whose Java class name isjava.lang.Short
.
INTEGER
public static final SimpleType INTEGER
- The
SimpleType
instance describing values whose Java class name isjava.lang.Integer
.
LONG
public static final SimpleType LONG
- The
SimpleType
instance describing values whose Java class name isjava.lang.Long
.
FLOAT
public static final SimpleType FLOAT
- The
SimpleType
instance describing values whose Java class name isjava.lang.Float
.
DOUBLE
public static final SimpleType DOUBLE
- The
SimpleType
instance describing values whose Java class name isjava.lang.Double
.
STRING
public static final SimpleType STRING
- The
SimpleType
instance describing values whose Java class name isjava.lang.String
.
BIGDECIMAL
public static final SimpleType BIGDECIMAL
- The
SimpleType
instance describing values whose Java class name isjava.math.BigDecimal
.
BIGINTEGER
public static final SimpleType BIGINTEGER
- The
SimpleType
instance describing values whose Java class name isjava.math.BigInteger
.
DATE
public static final SimpleType DATE
- The
SimpleType
instance describing values whose Java class name isjava.util.Date
.
OBJECTNAME
public static final SimpleType OBJECTNAME
- The
SimpleType
instance describing values whose Java class name isjavax.management.ObjectName
.
Method Detail isValue
public boolean isValue(Object obj)
- Tests whether obj is a value for this
SimpleType
instance.This method returns
true
if and only if obj is not null and obj's class name is the same as the className field defined for thisSimpleType
instance (ie the class name returned by the getClassName method).
- Specified by:
- isValue in class OpenType
- Parameters:
- obj - the object to be tested.
- Returns:
true
if obj is a value for thisSimpleType
instance.
equals
public boolean equals(Object obj)
- Compares the specified
obj
parameter with thisSimpleType
instance for equality.Two
SimpleType
instances are equal if and only if their getClassName methods return the same value.
- Specified by:
- equals in class OpenType
- Parameters:
- obj - the object to be compared for equality with this
SimpleType
instance; if obj isnull
or is not an instance of the classSimpleType
,equals
returnsfalse
.- Returns:
true
if the specified object is equal to thisSimpleType
instance.
hashCode
public int hashCode()
- Returns the hash code value for this
SimpleType
instance. The hash code of aSimpleType
instance is the the hash code of the string value returned by the getClassName method.As
SimpleType
instances are immutable, the hash code for this instance is calculated once, on the first call tohashCode
, and then the same value is returned for subsequent calls.
- Specified by:
- hashCode in class OpenType
- Returns:
- the hash code value for this
SimpleType
instance
toString
public String toString()
- Returns a string representation of this
SimpleType
instance.The string representation consists of the name of this class (ie
javax.management.openmbean.SimpleType
) and the type name for this instance (which is the java class name of the values thisSimpleType
instance represents).As
SimpleType
instances are immutable, the string representation for this instance is calculated once, on the first call totoString
, and then the same value is returned for subsequent calls.
- Specified by:
- toString in class OpenType
- Returns:
- a string representation of this
SimpleType
instance
readResolve
public Object readResolve() throws ObjectStreamException
- Replace an object read from an ObjectInputStream with the unique instance for that value.
- Returns:
- the replacement object.
- Throws:
- ObjectStreamException - if the read object cannot be resolved.
Submit a bug or featureCopyright 2003 Sun Microsystems, Inc. All rights reserved.