com.r3corda.core.serialization / SerializeAsToken

# SerializeAsToken

`interface SerializeAsToken`

This interface should be implemented by classes that want to substitute a token representation of themselves if they are serialized because they have a lot of internal state that does not serialize (well).

This models a similar pattern to the readReplace/writeReplace methods in Java serialization.

### Functions

toToken | `abstract fun toToken(context: SerializeAsTokenContext): SerializationToken`

### Inheritors

NodeClock | `class NodeClock : Clock, SerializeAsToken` A Clock that tokenizes itself when serialized, and delegates to an underlying Clock implementation.
SingletonSerializeAsToken | `abstract class SingletonSerializeAsToken : SerializeAsToken` A base class for implementing large objects / components / services that need to serialize themselves to a string token to indicate which instance the token is a serialized form of.
TestClock | `class TestClock : MutableClock, SerializeAsToken` A Clock that can have the date advanced for use in demos.