Package org.incendo.cloud.caption
Class CaptionRegistryImpl<C>
java.lang.Object
org.incendo.cloud.caption.CaptionRegistryImpl<C>
- All Implemented Interfaces:
CaptionRegistry<C>
@API(status=INTERNAL)
public final class CaptionRegistryImpl<C>
extends Object
implements CaptionRegistry<C>
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of the givencaptionfor the givensender.registerProvider(@NonNull CaptionProvider<C> provider) Registers the givenprovider.
-
Method Details
-
caption
Description copied from interface:CaptionRegistryReturns the value of the givencaptionfor the givensender.- Specified by:
captionin interfaceCaptionRegistry<C>- Parameters:
caption- the caption keysender- the sender to get the caption for- Returns:
- the caption value
-
registerProvider
Description copied from interface:CaptionRegistryRegisters the givenprovider.When
CaptionRegistry.caption(Caption, Object)is invoked, all providers will be iterated over (with the last registered provider getting priority) until a provider returns a non-nullvalue for the caption.You may use
CaptionProvider.forCaption(Caption, Function)to register per-caption providers, orCaptionProvider.constantProvider(Caption, String)to register constant values.- Specified by:
registerProviderin interfaceCaptionRegistry<C>- Parameters:
provider- the provider- Returns:
this
-