Interface Translator



  • public interface Translator
    Instance provides translation of text with dictionary keys to its translation.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String translate​(java.lang.String text)
      Translate single string.
      <K> java.util.Map<K,java.lang.String> translate​(java.util.Map<K,java.lang.String> original)
      Create new map with the same key set as original and translated values for each key.
      <K extends java.lang.Enum<K>>
      java.util.Map<K,java.lang.String>
      translateEnum​(java.util.Map<K,java.lang.String> original)
      Create new map with the same key set as original and translated values for each key.
    • Method Detail

      • translate

        java.lang.String translate​(java.lang.String text)
        Translate single string.
        Parameters:
        text - string with dictionary keys to translate
        Returns:
        translated string
      • translate

        <K> java.util.Map<K,java.lang.String> translate​(java.util.Map<K,java.lang.String> original)
        Create new map with the same key set as original and translated values for each key. Result is unmodifiable map backed by either instance of HashMap or Collections.EMPTY_MAP.
        Type Parameters:
        K - type of keys in maps
        Parameters:
        original - original map
        Returns:
        unmodifiable map with translated values
      • translateEnum

        <K extends java.lang.Enum<K>> java.util.Map<K,java.lang.String> translateEnum​(java.util.Map<K,java.lang.String> original)
        Create new map with the same key set as original and translated values for each key. Result is unmodifiable map backed by either instance of HashMap or Collections.EMPTY_MAP.
        Type Parameters:
        K - type of keys in map
        Parameters:
        original - original map
        Returns:
        unmodifiable map with translated values