Class Catalogue

java.lang.Object
com.ultikits.ultitools.text.internal.Catalogue

@Internal public final class Catalogue extends Object
Immutable, normalized catalogue snapshot for one namespace.
  • Field Details

  • Constructor Details

  • Method Details

    • namespace

      public String namespace()
      Returns the namespace.
    • sourceLocale

      public Locale sourceLocale()
      Returns the module's last-resort source language.
    • lookup

      public Optional<String> lookup(String path, Iterable<Locale> candidates)
      Returns the first exact candidate defining this path.
    • templates

      List<String> templates(String path)
      Returns the templates that define a path, sorted by language tag.
    • isDefined

      public boolean isDefined(String path, Locale locale)
      Checks the exact locale and its language without other fallbacks.
    • contains

      public boolean contains(String path)
      Checks whether any language defines a path.
    • hasLocale

      public boolean hasLocale(Locale locale)
      Checks whether a source-language file was supplied, including an empty one.
    • withOverrides

      public Catalogue withOverrides(Catalogue overrides)
      Returns a new snapshot with the same-language override entries taking precedence.