Class LangMap

    • Constructor Detail

      • LangMap

        public LangMap​(HashMap<LangTag,​String> input)
        Create a new langmap from a HashMap
        Parameters:
        input - a HashMap of RFC5646 Language Tags, and corresponding value strings
    • Method Detail

      • put

        public void put​(LangTag languageCode,
                        String value)
        Sets an entry in the Language Map
        Specified by:
        put in interface IFreeMap<LangTag,​String>
        Parameters:
        languageCode - the RFC 5646 LangTag of the specified Language
        value - a string in the language specified by languageCode
      • get

        public String get​(LangTag languageCode)
        Retrieve the value for a specific language.
        Specified by:
        get in interface IFreeMap<LangTag,​String>
        Parameters:
        languageCode - RFC 5646 LangTag
        Returns:
        The value in the language specified by the tag.
      • remove

        public void remove​(LangTag languageCode)
        Remove an entry from the Language Map
        Specified by:
        remove in interface IFreeMap<LangTag,​String>
        Parameters:
        languageCode - RFC 5646 LangTag
      • getKeys

        public Set<LangTag> getKeys()
        Retrieves the full set of RFC 5646 Language Tags contained in the Map
        Specified by:
        getKeys in interface IFreeMap<LangTag,​String>
        Returns:
        A set of RFC 5646 LangTag instances
      • getMap

        public Map<LangTag,​String> getMap()
        Retrieves the full Language Map in the form of a HashMap<String, String>
        Specified by:
        getMap in interface IFreeMap<LangTag,​String>
        Returns:
        The full Language Map
      • isEmpty

        @AssertFalse(message="Language Map must not be empty")
        public @jakarta.validation.constraints.AssertFalse(message="Language Map must not be empty") boolean isEmpty()
        Specified by:
        isEmpty in interface JSONObject