Class SimpleType<T>
- Type Parameters:
T- the Java type that values described by this SimpleType must have.
- 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SimpleType<BigDecimal> TheSimpleTypeinstance describing values whose Java class name isjava.math.BigDecimal.static final SimpleType<BigInteger> TheSimpleTypeinstance describing values whose Java class name isjava.math.BigInteger.static final SimpleType<Boolean> TheSimpleTypeinstance describing values whose Java class name isjava.lang.Boolean.static final SimpleType<Byte> TheSimpleTypeinstance describing values whose Java class name isjava.lang.Byte.static final SimpleType<Character> TheSimpleTypeinstance describing values whose Java class name isjava.lang.Character.static final SimpleType<Date> TheSimpleTypeinstance describing values whose Java class name isjava.util.Date.static final SimpleType<Double> TheSimpleTypeinstance describing values whose Java class name isjava.lang.Double.static final SimpleType<Float> TheSimpleTypeinstance describing values whose Java class name isjava.lang.Float.static final SimpleType<Integer> TheSimpleTypeinstance describing values whose Java class name isjava.lang.Integer.static final SimpleType<Long> TheSimpleTypeinstance describing values whose Java class name isjava.lang.Long.static final SimpleType<ObjectName> TheSimpleTypeinstance describing values whose Java class name isjavax.management.ObjectName.static final SimpleType<Short> TheSimpleTypeinstance describing values whose Java class name isjava.lang.Short.static final SimpleType<String> TheSimpleTypeinstance describing values whose Java class name isjava.lang.String.static final SimpleType<Void> TheSimpleTypeinstance describing values whose Java class name isjava.lang.Void.Fields inherited from class OpenType
ALLOWED_CLASSNAMES, ALLOWED_CLASSNAMES_LISTModifier and TypeFieldDescriptionstatic final String[]Deprecated.List of the fully qualified names of the Java classes allowed for open data values. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the specifiedobjparameter with thisSimpleTypeinstance for equality.inthashCode()Returns the hash code value for thisSimpleTypeinstance.booleanTests whether obj is a value for thisSimpleTypeinstance.Replace an object read from anObjectInputStreamwith the unique instance for that value.toString()Returns a string representation of thisSimpleTypeinstance.Methods inherited from class OpenType
getClassName, getDescription, getTypeName, isArrayModifier and TypeMethodDescriptionReturns the fully qualified Java class name of the open data values this open type describes.Returns the text description of thisOpenTypeinstance.Returns the name of thisOpenTypeinstance.booleanisArray()Returnstrueif the open data values this open type describes are arrays,falseotherwise.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Creates and returns a copy of this object.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class<?> getClass()Returns the runtime class of thisObject.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
VOID
TheSimpleTypeinstance describing values whose Java class name isjava.lang.Void. -
BOOLEAN
TheSimpleTypeinstance describing values whose Java class name isjava.lang.Boolean. -
CHARACTER
TheSimpleTypeinstance describing values whose Java class name isjava.lang.Character. -
BYTE
TheSimpleTypeinstance describing values whose Java class name isjava.lang.Byte. -
SHORT
TheSimpleTypeinstance describing values whose Java class name isjava.lang.Short. -
INTEGER
TheSimpleTypeinstance describing values whose Java class name isjava.lang.Integer. -
LONG
TheSimpleTypeinstance describing values whose Java class name isjava.lang.Long. -
FLOAT
TheSimpleTypeinstance describing values whose Java class name isjava.lang.Float. -
DOUBLE
TheSimpleTypeinstance describing values whose Java class name isjava.lang.Double. -
STRING
TheSimpleTypeinstance describing values whose Java class name isjava.lang.String. -
BIGDECIMAL
TheSimpleTypeinstance describing values whose Java class name isjava.math.BigDecimal. -
BIGINTEGER
TheSimpleTypeinstance describing values whose Java class name isjava.math.BigInteger. -
DATE
TheSimpleTypeinstance describing values whose Java class name isjava.util.Date. -
OBJECTNAME
TheSimpleTypeinstance describing values whose Java class name isjavax.management.ObjectName.
-
-
Method Details
-
isValue
Tests whether obj is a value for thisSimpleTypeinstance.This method returns
trueif and only if obj is not null and obj's class name is the same as the className field defined for thisSimpleTypeinstance (ie the class name returned by thegetClassNamemethod). -
equals
Compares the specifiedobjparameter with thisSimpleTypeinstance for equality.Two
SimpleTypeinstances are equal if and only if theirgetClassNamemethods return the same value. -
hashCode
public int hashCode()Returns the hash code value for thisSimpleTypeinstance. The hash code of aSimpleTypeinstance is the hash code of the string value returned by thegetClassNamemethod.As
SimpleTypeinstances 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. -
toString
Returns a string representation of thisSimpleTypeinstance.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 thisSimpleTypeinstance represents).As
SimpleTypeinstances 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 anObjectInputStreamwith the unique instance for that value.- Returns:
- the replacement object.
- Throws:
ObjectStreamException- if the read object cannot be resolved.
-
ALLOWED_CLASSNAMES_LISTinstead.