Package io.vertx.core.shareddata
Interface Shareable
-
- All Known Subinterfaces:
Buffer
,Destination
- All Known Implementing Classes:
CachedTemplate
,JsonArray
,JsonObject
public interface Shareable
An interface which allows you to put arbitrary objects into aLocalMap
.Normally local maps only allow immutable or copiable objects in order to avoid shared access to mutable state.
However if you have an object that you know is thread-safe you can mark it with this interface and then you will be able to add it to
LocalMap
instances.Mutable object that you want to store in a
LocalMap
should overridecopy()
method.Use this interface with caution.
- Author:
- Tim Fox
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Shareable
copy()
Returns a copy of the object.
-
-
-
Method Detail
-
copy
default Shareable copy()
Returns a copy of the object. Only mutable objects should provide a custom implementation of the method.
-
-