Skip to content

Registry

final class Registry<T>
Package: dev.joid.lib.utils.registry · Module: core · Source: Registry.java

Ordered list of registered values in which the most recent registration wins.

The registries of formats, resolvers, asset locators, markups, converters and key resolvers use it: a value registered later is tried first.

ReturnsSignatureSummary
Registry()Creates an empty registry.

ReturnsSignatureSummary
voidregister(T value)Puts value first; a value already registered moves to the front.
voidunregister(T value)Removes value.
Tfind(Predicate predicate)Returns the first value, from the most recent, that matches predicate, or null.
List<T>getAll()Returns the values from the most recent, read-only; the view follows the registrations.

Registry()

Creates an empty registry.

void register(T value)

Puts value first; a value already registered moves to the front.

void unregister(T value)

Removes value.

T find(Predicate<T> predicate)

Returns the first value, from the most recent, that matches predicate, or null.

List<T> getAll()

Returns the values from the most recent, read-only; the view follows the registrations.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page