Serializable
public final class ObjectStreamClass extends Object implements Serializable
The algorithm to compute the SerialVersionUID is described in Java Object Serialization Specification, Section 4.6, "Stream Unique Identifiers".
Modifier and Type | Field | Description |
---|---|---|
static final ObjectStreamField[] |
NO_FIELDS |
serialPersistentFields value indicating no serializable fields |
Modifier and Type | Method | Description |
---|---|---|
Class |
forClass() |
Return the class in the local VM that this version is mapped to. |
ObjectStreamField |
getField |
Get the field of this class by name. |
ObjectStreamField[] |
getFields() |
Return an array of the fields of this serializable class. |
String |
getName() |
Returns the name of the class described by this descriptor. |
long |
getSerialVersionUID() |
Return the serialVersionUID for this class. |
static ObjectStreamClass |
lookup |
Find the descriptor for a class that can be serialized. |
static ObjectStreamClass |
lookupAny |
Returns the descriptor for any class, regardless of whether it implements Serializable . |
String |
toString() |
Return a string describing this ObjectStreamClass. |
public static final ObjectStreamField[] NO_FIELDS
public static ObjectStreamClass lookup(Class<?> cl)
cl
- class for which to get the descriptorpublic static ObjectStreamClass lookupAny(Class<?> cl)
Serializable
.cl
- class for which to get the descriptorpublic String getName()
Class.getName()
method.public long getSerialVersionUID()
public Class<?> forClass()
Class
instance that this descriptor representspublic ObjectStreamField[] getFields()
public ObjectStreamField getField(String name)
name
- the name of the data field to look forpublic String toString()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/ObjectStreamClass.html