Top Description Methods
io.vertx.core.shareddata

public Interface Shareable

Known Direct Subinterfaces
io.vertx.core.buffer.Buffer
Known Direct Implementers
io.vertx.core.impl.SharedClientHolder, io.vertx.core.json.JsonArray, io.vertx.core.json.JsonObject

An interface which allows you to put arbitrary objects into a io.vertx.core.shareddata.LocalMap.

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 io.vertx.core.shareddata.LocalMap instances.

Mutable object that you want to store in a io.vertx.core.shareddata.LocalMap should override Shareable#copy() method.

Use this interface with caution.

Author
Tim Fox

Method Summary

Modifier and TypeMethod and Description
public default Shareable
copy()

Returns a copy of the object.

Method Detail

copyback to summary
public default Shareable copy()

Returns a copy of the object. Only mutable objects should provide a custom implementation of the method.