Skip to content

Commit 687dd63

Browse files
docs: deduplicate and refine comments (#84)
1 parent 54e8c73 commit 687dd63

30 files changed

+13595
-1937
lines changed

openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClient.kt

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ class OpenlayerOkHttpClient private constructor() {
146146

147147
fun apiKey(apiKey: String?) = apply { clientOptions.apiKey(apiKey) }
148148

149+
/** Alias for calling [Builder.apiKey] with `apiKey.orElse(null)`. */
149150
fun apiKey(apiKey: Optional<String>) = apiKey(apiKey.getOrNull())
150151

151152
fun fromEnv() = apply { clientOptions.fromEnv() }

openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClientAsync.kt

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ class OpenlayerOkHttpClientAsync private constructor() {
148148

149149
fun apiKey(apiKey: String?) = apply { clientOptions.apiKey(apiKey) }
150150

151+
/** Alias for calling [Builder.apiKey] with `apiKey.orElse(null)`. */
151152
fun apiKey(apiKey: Optional<String>) = apiKey(apiKey.getOrNull())
152153

153154
fun fromEnv() = apply { clientOptions.fromEnv() }

openlayer-java-core/src/main/kotlin/com/openlayer/api/core/ClientOptions.kt

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ private constructor(
9494

9595
fun apiKey(apiKey: String?) = apply { this.apiKey = apiKey }
9696

97+
/** Alias for calling [Builder.apiKey] with `apiKey.orElse(null)`. */
9798
fun apiKey(apiKey: Optional<String>) = apiKey(apiKey.getOrNull())
9899

99100
fun headers(headers: Headers) = apply {

openlayer-java-core/src/main/kotlin/com/openlayer/api/core/Timeout.kt

+4-31
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,7 @@ private constructor(
9090
*/
9191
fun connect(connect: Duration?) = apply { this.connect = connect }
9292

93-
/**
94-
* The maximum time allowed to establish a connection with a host.
95-
*
96-
* A value of [Duration.ZERO] means there's no timeout.
97-
*
98-
* Defaults to `Duration.ofMinutes(1)`.
99-
*/
93+
/** Alias for calling [Builder.connect] with `connect.orElse(null)`. */
10094
fun connect(connect: Optional<Duration>) = connect(connect.getOrNull())
10195

10296
/**
@@ -108,13 +102,7 @@ private constructor(
108102
*/
109103
fun read(read: Duration?) = apply { this.read = read }
110104

111-
/**
112-
* The maximum time allowed between two data packets when waiting for the server’s response.
113-
*
114-
* A value of [Duration.ZERO] means there's no timeout.
115-
*
116-
* Defaults to `request()`.
117-
*/
105+
/** Alias for calling [Builder.read] with `read.orElse(null)`. */
118106
fun read(read: Optional<Duration>) = read(read.getOrNull())
119107

120108
/**
@@ -126,13 +114,7 @@ private constructor(
126114
*/
127115
fun write(write: Duration?) = apply { this.write = write }
128116

129-
/**
130-
* The maximum time allowed between two data packets when sending the request to the server.
131-
*
132-
* A value of [Duration.ZERO] means there's no timeout.
133-
*
134-
* Defaults to `request()`.
135-
*/
117+
/** Alias for calling [Builder.write] with `write.orElse(null)`. */
136118
fun write(write: Optional<Duration>) = write(write.getOrNull())
137119

138120
/**
@@ -147,16 +129,7 @@ private constructor(
147129
*/
148130
fun request(request: Duration?) = apply { this.request = request }
149131

150-
/**
151-
* The maximum time allowed for a complete HTTP call, not including retries.
152-
*
153-
* This includes resolving DNS, connecting, writing the request body, server processing, as
154-
* well as reading the response body.
155-
*
156-
* A value of [Duration.ZERO] means there's no timeout.
157-
*
158-
* Defaults to `Duration.ofMinutes(1)`.
159-
*/
132+
/** Alias for calling [Builder.request] with `request.orElse(null)`. */
160133
fun request(request: Optional<Duration>) = request(request.getOrNull())
161134

162135
fun build(): Timeout = Timeout(connect, read, write, request)

0 commit comments

Comments
 (0)