Interface CaptionMap

All Known Implementing Classes:
DummyCaptionMap, LocalizedCaptionMap, PerUserLocaleCaptionMap

public interface CaptionMap
Map containing mappings between captions and components
  • Method Details

    • getMessage

      @NonNull String getMessage(@NonNull TranslatableCaption caption) throws CaptionMap.NoSuchCaptionException
      Get a message using the server locale
      Parameters:
      caption - Caption containing the caption key
      Returns:
      Component
      Throws:
      CaptionMap.NoSuchCaptionException - if no caption with the given key exists
    • getMessage

      @NonNull String getMessage(@NonNull TranslatableCaption caption, @NonNull LocaleHolder localeHolder) throws CaptionMap.NoSuchCaptionException
      Get a message using a specific locale
      Parameters:
      caption - Caption containing the caption key
      localeHolder - Holder that determines the message locale
      Returns:
      Component
      Throws:
      CaptionMap.NoSuchCaptionException - if no caption with the given key exists
    • supportsLocale

      boolean supportsLocale(@NonNull Locale locale)
      Check if the map supports a given locale
      Parameters:
      locale - Locale
      Returns:
      True if the map supports the locale
    • getLocale

      @NonNull Locale getLocale()
      Get the locale of the messages stored in the map
      Returns:
      Message locale
    • getCaptions

      @NonNull Set<TranslatableCaption> getCaptions()
      Gets a copy of the set of captions stored in the CaptionMap
      Returns:
      An immutable set of TranslatableCaption