- All Implemented Interfaces:
Serializable
SimpleType
class is the open type class whose instances describe
all open data values which are neither arrays,
nor CompositeData
values,
nor TabularData
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 this SimpleType
instance
are also set to className.
In other words, its methods getClassName
, getTypeName
and getDescription
all return the same string value className.
- Since:
- 1.5
- See Also:
- Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionstatic 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 declared in class javax.management.openmbean.OpenType
ALLOWED_CLASSNAMES, ALLOWED_CLASSNAMES_LIST
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the specifiedobj
parameter with thisSimpleType
instance for equality.int
hashCode()
Returns the hash code value for thisSimpleType
instance.boolean
Tests whether obj is a value for thisSimpleType
instance.Replace an object read from anObjectInputStream
with the unique instance for that value.toString()
Returns a string representation of thisSimpleType
instance.Methods declared in class javax.management.openmbean.OpenType
getClassName, getDescription, getTypeName, isArray
-
Field Details
-
VOID
TheSimpleType
instance describing values whose Java class name isjava.lang.Void
. -
BOOLEAN
TheSimpleType
instance describing values whose Java class name isjava.lang.Boolean
. -
CHARACTER
TheSimpleType
instance describing values whose Java class name isjava.lang.Character
. -
BYTE
TheSimpleType
instance describing values whose Java class name isjava.lang.Byte
. -
SHORT
TheSimpleType
instance describing values whose Java class name isjava.lang.Short
. -
INTEGER
TheSimpleType
instance describing values whose Java class name isjava.lang.Integer
. -
LONG
TheSimpleType
instance describing values whose Java class name isjava.lang.Long
. -
FLOAT
TheSimpleType
instance describing values whose Java class name isjava.lang.Float
. -
DOUBLE
TheSimpleType
instance describing values whose Java class name isjava.lang.Double
. -
STRING
TheSimpleType
instance describing values whose Java class name isjava.lang.String
. -
BIGDECIMAL
TheSimpleType
instance describing values whose Java class name isjava.math.BigDecimal
. -
BIGINTEGER
TheSimpleType
instance describing values whose Java class name isjava.math.BigInteger
. -
DATE
TheSimpleType
instance describing values whose Java class name isjava.util.Date
. -
OBJECTNAME
TheSimpleType
instance describing values whose Java class name isjavax.management.ObjectName
.
-
-
Method Details
-
isValue
Tests whether obj is a value for thisSimpleType
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 thegetClassName
method). -
equals
Compares the specifiedobj
parameter with thisSimpleType
instance for equality.Two
SimpleType
instances are equal if and only if theirgetClassName
methods return the same value.- Specified by:
equals
in classOpenType<T>
- Parameters:
obj
- the object to be compared for equality with thisSimpleType
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.- See Also:
Object.hashCode()
,HashMap
-
hashCode
public int hashCode()Returns the hash code value for thisSimpleType
instance. The hash code of aSimpleType
instance is the hash code of the string value returned by thegetClassName
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.- Overrides:
hashCode
in classObject
- Returns:
- the hash code value for this
SimpleType
instance - See Also:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
toString
Returns a string representation of thisSimpleType
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. -
readResolve
Replace an object read from anObjectInputStream
with the unique instance for that value.- Returns:
- the replacement object.
- Throws:
ObjectStreamException
- if the read object cannot be resolved.
-