Skip to content

Commit cee8123

Browse files
committed
fix: Fix README constructor example for DeepLClient by adding an overloaded constructor
1 parent 9087e77 commit cee8123

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

deepl-java/src/main/java/com/deepl/api/DeepLClient.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,32 @@
1212

1313
public class DeepLClient extends Translator {
1414

15-
/** {@inheritDoc} */
16-
public DeepLClient(String authKey, TranslatorOptions options) throws IllegalArgumentException {
15+
/**
16+
* Initializes a new DeepLClient object using your Authentication Key.
17+
*
18+
* <p>Note: This function does not establish a connection to the DeepL API. To check connectivity,
19+
* use {@link DeepLClient#getUsage()}.
20+
*
21+
* @param authKey DeepL Authentication Key as found in your <a
22+
* href="https://www.deepl.com/pro-account/">DeepL account</a>.
23+
* @throws IllegalArgumentException If authKey is invalid.
24+
*/
25+
public DeepLClient(String authKey) throws IllegalArgumentException {
26+
this(authKey, new DeepLClientOptions());
27+
}
28+
29+
/**
30+
* Initializes a new DeepLClient object using your Authentication Key.
31+
*
32+
* <p>Note: This function does not establish a connection to the DeepL API. To check connectivity,
33+
* use {@link DeepLClient#getUsage()}.
34+
*
35+
* @param authKey DeepL Authentication Key as found in your <a
36+
* href="https://www.deepl.com/pro-account/">DeepL account</a>.
37+
* @param options Additional options controlling Client behaviour.
38+
* @throws IllegalArgumentException If authKey is invalid.
39+
*/
40+
public DeepLClient(String authKey, DeepLClientOptions options) throws IllegalArgumentException {
1741
super(authKey, options);
1842
}
1943

0 commit comments

Comments
 (0)