Class SimpleType<T>

java.lang.Object
javax.management.openmbean.OpenType<T>
javax.management.openmbean.SimpleType<T>
Type Parameters:
T - the Java type that values described by this SimpleType must have.
All Implemented Interfaces:
Serializable

public final class SimpleType<T> extends OpenType<T>
The 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

    Fields
    Modifier and Type
    Field
    Description
    static final SimpleType<BigDecimal>
    The SimpleType instance describing values whose Java class name is java.math.BigDecimal.
    static final SimpleType<BigInteger>
    The SimpleType instance describing values whose Java class name is java.math.BigInteger.
    static final SimpleType<Boolean>
    The SimpleType instance describing values whose Java class name is java.lang.Boolean.
    static final SimpleType<Byte>
    The SimpleType instance describing values whose Java class name is java.lang.Byte.
    static final SimpleType<Character>
    The SimpleType instance describing values whose Java class name is java.lang.Character.
    static final SimpleType<Date>
    The SimpleType instance describing values whose Java class name is java.util.Date.
    static final SimpleType<Double>
    The SimpleType instance describing values whose Java class name is java.lang.Double.
    static final SimpleType<Float>
    The SimpleType instance describing values whose Java class name is java.lang.Float.
    static final SimpleType<Integer>
    The SimpleType instance describing values whose Java class name is java.lang.Integer.
    static final SimpleType<Long>
    The SimpleType instance describing values whose Java class name is java.lang.Long.
    static final SimpleType<ObjectName>
    The SimpleType instance describing values whose Java class name is javax.management.ObjectName.
    static final SimpleType<Short>
    The SimpleType instance describing values whose Java class name is java.lang.Short.
    static final SimpleType<String>
    The SimpleType instance describing values whose Java class name is java.lang.String.
    static final SimpleType<Void>
    The SimpleType instance describing values whose Java class name is java.lang.Void.

    Fields declared in class OpenType

    ALLOWED_CLASSNAMES, ALLOWED_CLASSNAMES_LIST
    Modifier and Type
    Field
    Description
    static final String[]
    Deprecated.
    static final List<String>
    List of the fully qualified names of the Java classes allowed for open data values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares the specified obj parameter with this SimpleType instance for equality.
    int
    Returns the hash code value for this SimpleType instance.
    boolean
    Tests whether obj is a value for this SimpleType instance.
    Replace an object read from an ObjectInputStream with the unique instance for that value.
    Returns a string representation of this SimpleType instance.

    Methods declared in class OpenType

    getClassName, getDescription, getTypeName, isArray
    Modifier and Type
    Method
    Description
    Returns the fully qualified Java class name of the open data values this open type describes.
    Returns the text description of this OpenType instance.
    Returns the name of this OpenType instance.
    boolean
    Returns true if the open data values this open type describes are arrays, false otherwise.

    Methods declared in class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
  • Field Details

    • VOID

      public static final SimpleType<Void> VOID
      The SimpleType instance describing values whose Java class name is java.lang.Void.
    • BOOLEAN

      public static final SimpleType<Boolean> BOOLEAN
      The SimpleType instance describing values whose Java class name is java.lang.Boolean.
    • CHARACTER

      public static final SimpleType<Character> CHARACTER
      The SimpleType instance describing values whose Java class name is java.lang.Character.
    • BYTE

      public static final SimpleType<Byte> BYTE
      The SimpleType instance describing values whose Java class name is java.lang.Byte.
    • SHORT

      public static final SimpleType<Short> SHORT
      The SimpleType instance describing values whose Java class name is java.lang.Short.
    • INTEGER

      public static final SimpleType<Integer> INTEGER
      The SimpleType instance describing values whose Java class name is java.lang.Integer.
    • LONG

      public static final SimpleType<Long> LONG
      The SimpleType instance describing values whose Java class name is java.lang.Long.
    • FLOAT

      public static final SimpleType<Float> FLOAT
      The SimpleType instance describing values whose Java class name is java.lang.Float.
    • DOUBLE

      public static final SimpleType<Double> DOUBLE
      The SimpleType instance describing values whose Java class name is java.lang.Double.
    • STRING

      public static final SimpleType<String> STRING
      The SimpleType instance describing values whose Java class name is java.lang.String.
    • BIGDECIMAL

      public static final SimpleType<BigDecimal> BIGDECIMAL
      The SimpleType instance describing values whose Java class name is java.math.BigDecimal.
    • BIGINTEGER

      public static final SimpleType<BigInteger> BIGINTEGER
      The SimpleType instance describing values whose Java class name is java.math.BigInteger.
    • DATE

      public static final SimpleType<Date> DATE
      The SimpleType instance describing values whose Java class name is java.util.Date.
    • OBJECTNAME

      public static final SimpleType<ObjectName> OBJECTNAME
      The SimpleType instance describing values whose Java class name is javax.management.ObjectName.
  • Method Details

    • 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 this SimpleType instance (ie the class name returned by the getClassName method).

      Specified by:
      isValue in class OpenType<T>
      Parameters:
      obj - the object to be tested.
      Returns:
      true if obj is a value for this SimpleType instance.
    • equals

      public boolean equals(Object obj)
      Compares the specified obj parameter with this SimpleType 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<T>
      Parameters:
      obj - the object to be compared for equality with this SimpleType instance; if obj is null or is not an instance of the class SimpleType, equals returns false.
      Returns:
      true if the specified object is equal to this SimpleType instance.
      See Also:
    • hashCode

      public int hashCode()
      Returns the hash code value for this SimpleType instance. The hash code of a SimpleType instance is 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 to hashCode, and then the same value is returned for subsequent calls.

      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this SimpleType instance
      See Also:
    • 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 this SimpleType instance represents).

      As SimpleType instances are immutable, the string representation for this instance is calculated once, on the first call to toString, and then the same value is returned for subsequent calls.

      Specified by:
      toString in class OpenType<T>
      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.