copySelfAs

copySelfAs(asClass:   Class;
           transient: Boolean): Object;

The copySelfAs method of the Object class creates a new instance of the class specified in the asClass parameter, invoking constructor methods if defined, and copies any attributes of the receiver (including the contents of primitive arrays) that are common to both the receiver and target class definitions; that is, those attributes defined in a "common ancestor" class.

References and MemoryAddress attributes are not copied and are initialized to null in the copied object.

See also the Object class copySelf method and the cloneSelf and cloneSelfAs methods, which do not invoke constructors.