public final Object attach (Object ob)

Attaches the given object to this key.

An attached object may later be retrieved via the attachment() method. Only one object may be attached at a time; invoking this method causes any previous attachment to be discarded. The current attachment may be discarded by attaching null.

Parameters:
ob     The object to be attached; may be null

Returns:  The previously-attached object, if any, otherwise null