Class ModelMapUtil


  • public class ModelMapUtil
    extends Object
    • Constructor Detail

      • ModelMapUtil

        public ModelMapUtil()
    • Method Detail

      • setMap

        public void setMap​(String modelMap)
        Sets the map for this object.
        Parameters:
        modelMap - the JSON map to store. The expected format is for example: {"en-US/ja-JP": "projects/my-project/locations/us-central1/models/ABC123", "en-US/de-DE": "projects/my-project/locations/us-central1/models/DEF456"}
      • getModelResourceName

        public String getModelResourceName​(String sourceCode,
                                           String targetCode)
        Gets the model resource name for a given language pair.
        Parameters:
        sourceCode - the code of the source language (not case-sensitive)
        targetCode - the code of the target language (not case-sensitive)
        Returns:
        the model resource name for the given language pair.
        Throws:
        OkapiException - if the language pair is not found.