T- the type of marshaller, implementing this interface
public interface StatefulCopyable<T extends StatefulCopyable<T>>
Cloneable-like interface used by Chronicle Map to populate stateful serializer implementations for each isolated site (thread + Chronicle Map instance + objects domain). Stateful implementations of serialization interfaces (
DataAccess), configured for
ChronicleSetin builder, should implement the
StatefulCopyable section in the Chronicle Map tutorial for more info
on how to implement and use this interface properly, and for examples.
|Modifier and Type||Method and Description|
Creates a copy of this marshaller, with independent state.
copy()is called, should be inherited in the copy (e. g. the class of objects serialized). So,
copy()should be transitive, i. e.
marshaller.copy().copy()should result to identical instances.
The state of the instance on which
copy() is called shouldn't be changed.
If some marshaller is ought to implement
StatefulCopyable interface (e. g.
DataAccess) but is stateless actually, it could return
this from this method.
static <T> T copyIfNeeded(T possiblyStatefulCopyable)
StatefulCopyable, then returns
copy()of it, otherwise returns the
T- the type of the passed instance
possiblyStatefulCopyable- the instance to
copy()if it implements
StatefulCopyable, or to return without modification
Copyright © 2017. All rights reserved.