hunt.proton.engine.ExtendableAccessor

Undocumented in source.

Members

Classes

ExtendableAccessor
class ExtendableAccessor(E, T)

A typesafe convenience class for associating additional data with {@link Extendable} classes. <p> An instance of <code>ExtendableAccessor</code> uses itself as the key in the {@link Extendable#attachments()} so it's best instantiated as a static member. <pre><code> class Foo extends BaseHandler { private static ExtendableAccessor&lt;Link, Bar&gt; LINK_BAR = new ExtendableAccessor&lt;&gt;(Bar.class); void onLinkRemoteOpen(Event e) { Bar bar = LINK_BAR.get(e.getLink()); if (bar is null) { bar = new Bar(); LINK_BAR.set(e.getLink(), bar); } } } </code></pre>

Meta