-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathConfiguration.java
More file actions
63 lines (54 loc) · 1.9 KB
/
Configuration.java
File metadata and controls
63 lines (54 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Croct Export
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.5.0
* Contact: apis@croct.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.croct.client.export;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0-SNAPSHOT")
public class Configuration {
public static final String VERSION = "0.5.0";
private static final AtomicReference<ApiClient> defaultApiClient = new AtomicReference<>();
private static volatile Supplier<ApiClient> apiClientFactory = ApiClient::new;
/**
* Get the default API client, which would be used when creating API instances without providing an API client.
*
* @return Default API client
*/
public static ApiClient getDefaultApiClient() {
ApiClient client = defaultApiClient.get();
if (client == null) {
client = defaultApiClient.updateAndGet(val -> {
if (val != null) { // changed by another thread
return val;
}
return apiClientFactory.get();
});
}
return client;
}
/**
* Set the default API client, which would be used when creating API instances without providing an API client.
*
* @param apiClient API client
*/
public static void setDefaultApiClient(ApiClient apiClient) {
defaultApiClient.set(apiClient);
}
/**
* set the callback used to create new ApiClient objects
*/
public static void setApiClientFactory(Supplier<ApiClient> factory) {
apiClientFactory = Objects.requireNonNull(factory);
}
private Configuration() {
}
}