- java.lang.Object
-
- javax.management.openmbean.OpenType<T>
-
- javax.management.openmbean.SimpleType<T>
-
- All Implemented Interfaces:
- Serializable
public final class SimpleType<T> extends OpenType<T>
TheSimpleType
class is the open type class whose instances describe all open data values which are neither arrays, nor
values, norCompositeData
values. It predefines all its possible instances as static fields, and has no public constructor.TabularData
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:
- 1.5
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static SimpleType<BigDecimal>
BIGDECIMAL
TheSimpleType
instance describing values whose Java class name isjava.math.BigDecimal
.static SimpleType<BigInteger>
BIGINTEGER
TheSimpleType
instance describing values whose Java class name isjava.math.BigInteger
.static SimpleType<Boolean>
BOOLEAN
TheSimpleType
instance describing values whose Java class name isjava.lang.Boolean
.static SimpleType<Byte>
BYTE
TheSimpleType
instance describing values whose Java class name isjava.lang.Byte
.static SimpleType<Character>
CHARACTER
TheSimpleType
instance describing values whose Java class name isjava.lang.Character
.static SimpleType<Date>
DATE
TheSimpleType
instance describing values whose Java class name isjava.util.Date
.static SimpleType<Double>
DOUBLE
TheSimpleType
instance describing values whose Java class name isjava.lang.Double
.static SimpleType<Float>
FLOAT
TheSimpleType
instance describing values whose Java class name isjava.lang.Float
.static SimpleType<Integer>
INTEGER
TheSimpleType
instance describing values whose Java class name isjava.lang.Integer
.static SimpleType<Long>
LONG
TheSimpleType
instance describing values whose Java class name isjava.lang.Long
.static SimpleType<ObjectName>
OBJECTNAME
TheSimpleType
instance describing values whose Java class name isjavax.management.ObjectName
.static SimpleType<Short>
SHORT
TheSimpleType
instance describing values whose Java class name isjava.lang.Short
.static SimpleType<String>
STRING
TheSimpleType
instance describing values whose Java class name isjava.lang.String
.static SimpleType<Void>
VOID
TheSimpleType
instance describing values whose Java class name isjava.lang.Void
.-
Fields inherited from class javax.management.openmbean.OpenType
ALLOWED_CLASSNAMES, ALLOWED_CLASSNAMES_LIST
-
-
Method Summary
Methods Modifier and Type Method and Description 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 anObjectInputStream
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
-
-
-
-
Field Detail
-
VOID
public static final SimpleType<Void> VOID
TheSimpleType
instance describing values whose Java class name isjava.lang.Void
.
-
BOOLEAN
public static final SimpleType<Boolean> BOOLEAN
TheSimpleType
instance describing values whose Java class name isjava.lang.Boolean
.
-
CHARACTER
public static final SimpleType<Character> CHARACTER
TheSimpleType
instance describing values whose Java class name isjava.lang.Character
.
-
BYTE
public static final SimpleType<Byte> BYTE
TheSimpleType
instance describing values whose Java class name isjava.lang.Byte
.
-
SHORT
public static final SimpleType<Short> SHORT
TheSimpleType
instance describing values whose Java class name isjava.lang.Short
.
-
INTEGER
public static final SimpleType<Integer> INTEGER
TheSimpleType
instance describing values whose Java class name isjava.lang.Integer
.
-
LONG
public static final SimpleType<Long> LONG
TheSimpleType
instance describing values whose Java class name isjava.lang.Long
.
-
FLOAT
public static final SimpleType<Float> FLOAT
TheSimpleType
instance describing values whose Java class name isjava.lang.Float
.
-
DOUBLE
public static final SimpleType<Double> DOUBLE
TheSimpleType
instance describing values whose Java class name isjava.lang.Double
.
-
STRING
public static final SimpleType<String> STRING
TheSimpleType
instance describing values whose Java class name isjava.lang.String
.
-
BIGDECIMAL
public static final SimpleType<BigDecimal> BIGDECIMAL
TheSimpleType
instance describing values whose Java class name isjava.math.BigDecimal
.
-
BIGINTEGER
public static final SimpleType<BigInteger> BIGINTEGER
TheSimpleType
instance describing values whose Java class name isjava.math.BigInteger
.
-
DATE
public static final SimpleType<Date> DATE
TheSimpleType
instance describing values whose Java class name isjava.util.Date
.
-
OBJECTNAME
public static final SimpleType<ObjectName> OBJECTNAME
TheSimpleType
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 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
public boolean equals(Object obj)
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 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.- Specified by:
hashCode
in classOpenType<T>
- Returns:
- the hash code value for this
SimpleType
instance - See Also:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
toString
public String 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
public Object readResolve() throws ObjectStreamException
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.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/11/2024 22:08:34 Cette version de la page est en cache (à la date du 21/11/2024 22:08:34) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 31/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/management/openmbean/simpletype.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.