public class RemoteTranslateHelper extends Object
getOptions()
()} method. Returned options have custom ServiceOptions.getRetrySettings()
: RetrySettings.getMaxAttempts()
is 10
,
RetrySettings.getMaxRetryDelay()
is 30000
, RetrySettings.getTotalTimeout()
is 120000
and RetrySettings.getInitialRetryDelay()
is 250
. HttpTransportOptions.getConnectTimeout()
and HttpTransportOptions.getReadTimeout()
are
both both set to 60000
.Modifier and Type | Class and Description |
---|---|
static class |
RemoteTranslateHelper.TranslateHelperException |
Modifier and Type | Method and Description |
---|---|
static RemoteTranslateHelper |
create()
Creates a
RemoteTranslateHelper object using default project id and authentication
credentials. |
static RemoteTranslateHelper |
create(String apiKey)
Deprecated.
|
static RemoteTranslateHelper |
create(String projectId,
InputStream keyStream)
Creates a
RemoteTranslateHelper object for the given project id and JSON key input
stream. |
TranslateOptions |
getOptions()
Returns a
TranslateOptions object to be used for testing. |
public TranslateOptions getOptions()
TranslateOptions
object to be used for testing.public static RemoteTranslateHelper create(String projectId, InputStream keyStream) throws RemoteTranslateHelper.TranslateHelperException
RemoteTranslateHelper
object for the given project id and JSON key input
stream.projectId
- id of the project to be used for running the testskeyStream
- input stream for a JSON keyRemoteTranslateHelper
object for the provided optionsRemoteTranslateHelper.TranslateHelperException
- if
keyStream
is not a valid JSON key stream@Deprecated public static RemoteTranslateHelper create(String apiKey)
RemoteTranslateHelper
object for the given API key.apiKey
- API key used to issue requests to Google Translation.public static RemoteTranslateHelper create()
RemoteTranslateHelper
object using default project id and authentication
credentials.Copyright © 2022 Google LLC. All rights reserved.