Class HttpTranslateRpc
- java.lang.Object
-
- com.google.cloud.translate.spi.v2.HttpTranslateRpc
-
- All Implemented Interfaces:
com.google.cloud.ServiceRpc,TranslateRpc
public class HttpTranslateRpc extends Object implements TranslateRpc
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.cloud.translate.spi.v2.TranslateRpc
TranslateRpc.Option
-
-
Constructor Summary
Constructors Constructor Description HttpTranslateRpc(TranslateOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<List<com.google.api.services.translate.model.DetectionsResourceItems>>detect(List<String> texts)Detects the language of the provided texts.List<com.google.api.services.translate.model.LanguagesResource>listSupportedLanguages(Map<TranslateRpc.Option,?> optionMap)Returns a list of the languages supported by Google Translation.List<com.google.api.services.translate.model.TranslationsResource>translate(List<String> texts, Map<TranslateRpc.Option,?> optionMap)Translates the provided texts.
-
-
-
Constructor Detail
-
HttpTranslateRpc
public HttpTranslateRpc(TranslateOptions options)
-
-
Method Detail
-
detect
public List<List<com.google.api.services.translate.model.DetectionsResourceItems>> detect(List<String> texts)
Description copied from interface:TranslateRpcDetects the language of the provided texts.- Specified by:
detectin interfaceTranslateRpc- Parameters:
texts- the texts to translate- Returns:
- a list of lists of detections, one list of detections for each provided text, in order
-
listSupportedLanguages
public List<com.google.api.services.translate.model.LanguagesResource> listSupportedLanguages(Map<TranslateRpc.Option,?> optionMap)
Description copied from interface:TranslateRpcReturns a list of the languages supported by Google Translation.- Specified by:
listSupportedLanguagesin interfaceTranslateRpc- Parameters:
optionMap- options to listing language translations
-
translate
public List<com.google.api.services.translate.model.TranslationsResource> translate(List<String> texts, Map<TranslateRpc.Option,?> optionMap)
Description copied from interface:TranslateRpcTranslates the provided texts.- Specified by:
translatein interfaceTranslateRpc- Parameters:
texts- the texts to translateoptionMap- options to text translation- Returns:
- a list of resources containing translation information, in the same order of the provided texts
-
-