ObjectStreamField

Creates an ObjectStreamField representing a serializable field with the
given name and type. If unshared is false, values of the represented
field are serialized and deserialized in the default manner--if the
field is non-primitive, object values are serialized and deserialized as
if they had been written and read by calls to writeObject and
readObject. If unshared is true, values of the represented field are
serialized and deserialized as if they had been written and read by
calls to writeUnshared and readUnshared.

Parameters:

name - field name

type - field type

unshared - if false, write/read field values in the same manner
as writeObject/readObject; if true, write/read in the same
manner as writeUnshared/readUnshared

Since:

1.4

Method Detail

getName

getType

Get the type of the field. If the type is non-primitive and this
ObjectStreamField was obtained from a deserialized ObjectStreamClass instance, then Object.class is returned.
Otherwise, the Class object for the type of the field is
returned.

compareTo

Compare this field with another ObjectStreamField. Return
-1 if this is smaller, 0 if equal, 1 if greater. Types that are
primitives are "smaller" than object types. If equal, the field names
are compared.