Class LionBundle


  • public final class LionBundle
    extends Object
    Encapsulates a bundle of localization strings.
    • Method Detail

      • id

        public String id()
        Returns the bundle's identifier.
        Returns:
        the bundle's ID
      • size

        public int size()
        Returns the number of entries in this bundle.
        Returns:
        number of entries
      • getValue

        public String getValue​(String key)
        Returns the localized value for the given key, or null if no such mapping exists.
        Parameters:
        key - the key
        Returns:
        the localized value
      • getSafe

        public String getSafe​(String key)
        Returns the localized value for the given key, or, if no such mapping exists, returns the key wrapped in '%' characters.
        Parameters:
        key - the key
        Returns:
        the localized value (or a wrapped key placeholder)
      • getSafe

        public String getSafe​(Enum<?> enumConst)
        Converts the given enum constant to lowercase and then uses that as the key to invoke getSafe(String).
        Parameters:
        enumConst - the constant to use as the key
        Returns:
        the localized value (or a wrapped key placeholder)
      • getItems

        public Set<LionBundle.LionItem> getItems()
        Returns an immutable set of the items in this bundle.
        Returns:
        the items in this bundle
      • dump

        public String dump()
        Dump the contents of the bundle.
        Returns:
        dumped contents