Java™ Platform
Standard Ed. 8
compact1, compact2, compact3
java.io
Class ObjectStreamClass
-
-
Field Summary
Fields
| Modifier and Type |
Field |
Description |
static ObjectStreamField[] |
NO_FIELDS |
serialPersistentFields value indicating no serializable fields
|
-
-
Method Detail
-
lookup
public static ObjectStreamClass lookup(Class<?> cl)
Find the descriptor for a class that can be serialized. Creates an
ObjectStreamClass instance if one does not exist yet for class. Null is
returned if the specified class does not implement java.io.Serializable
or java.io.Externalizable.
- Parameters:
cl - class for which to get the descriptor
- Returns:
- the class descriptor for the specified class
-
getName
public String getName()
Returns the name of the class described by this descriptor.
This method returns the name of the class in the format that
is used by the
Class.getName() method.
- Returns:
- a string representing the name of the class
-
getSerialVersionUID
public long getSerialVersionUID()
Return the serialVersionUID for this class. The serialVersionUID
defines a set of classes all with the same name that have evolved from a
common root class and agree to be serialized and deserialized using a
common format. NonSerializable classes have a serialVersionUID of 0L.
- Returns:
- the SUID of the class described by this descriptor
Java™ Platform
Standard Ed. 8
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.