Skip to content

Commit a6985bf

Browse files
committed
fix null and doc
1 parent b95d257 commit a6985bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/java/libraries/okhttp-gson/api.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class {{classname}} extends ApiClient {
4848

4949
public {{classname}}(String appId, String apiKey, String region, ClientOptions options) {
5050
super(appId, apiKey, "{{{baseName}}}", "{{{packageVersion}}}", options);
51-
if (options != null && options.getHosts() == null) {
51+
if (options != null && options.getHosts() != null) {
5252
this.setHosts(options.getHosts());
5353
} else {
5454
this.setHosts(getDefaultHosts(region));
@@ -66,7 +66,7 @@ public class {{classname}} extends ApiClient {
6666

6767
public {{classname}}(String appId, String apiKey, ClientOptions options) {
6868
super(appId, apiKey, "{{{baseName}}}", "{{{packageVersion}}}", options);
69-
if (options != null && options.getHosts() == null) {
69+
if (options != null && options.getHosts() != null) {
7070
this.setHosts(options.getHosts());
7171
} else {
7272
this.setHosts(getDefaultHosts(appId));

website/docs/clients/guides/customized-client-usage.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ import com.algolia.api.SearchClient;
9797
SearchClient client = new SearchClient(
9898
"<YOUR_APP_ID>",
9999
"<YOUR_API_KEY>",
100-
ClientOptions.build().addAlgoliaAgentSegments("my user agent", "optional version")
100+
new ClientOptions().addAlgoliaAgentSegments("my user agent", "optional version")
101101
);
102102
```
103103

@@ -135,7 +135,7 @@ import com.algolia.api.SearchClient;
135135
SearchClient client = new SearchClient(
136136
"<YOUR_APP_ID>",
137137
"<YOUR_API_KEY>",
138-
ClientOptions.build().setRequester(new MyOwnRequester())
138+
new ClientOptions().setRequester(new MyOwnRequester())
139139
);
140140
```
141141

0 commit comments

Comments
 (0)