Skip to content

Commit 11ae6b9

Browse files
docs: add build method comments (#286)
1 parent 8947c24 commit 11ae6b9

File tree

63 files changed

+2265
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2265
-0
lines changed

onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClient.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ class OnebusawaySdkOkHttpClient private constructor() {
148148

149149
fun fromEnv() = apply { clientOptions.fromEnv() }
150150

151+
/**
152+
* Returns an immutable instance of [OnebusawaySdkClient].
153+
*
154+
* Further updates to this [Builder] will not mutate the returned instance.
155+
*/
151156
fun build(): OnebusawaySdkClient =
152157
OnebusawaySdkClientImpl(
153158
clientOptions

onebusaway-sdk-kotlin-client-okhttp/src/main/kotlin/org/onebusaway/client/okhttp/OnebusawaySdkOkHttpClientAsync.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ class OnebusawaySdkOkHttpClientAsync private constructor() {
149149

150150
fun fromEnv() = apply { clientOptions.fromEnv() }
151151

152+
/**
153+
* Returns an immutable instance of [OnebusawaySdkClientAsync].
154+
*
155+
* Further updates to this [Builder] will not mutate the returned instance.
156+
*/
152157
fun build(): OnebusawaySdkClientAsync =
153158
OnebusawaySdkClientAsyncImpl(
154159
clientOptions

onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/ClientOptions.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,19 @@ private constructor(
172172

173173
fun fromEnv() = apply { System.getenv("ONEBUSAWAY_API_KEY")?.let { apiKey(it) } }
174174

175+
/**
176+
* Returns an immutable instance of [ClientOptions].
177+
*
178+
* Further updates to this [Builder] will not mutate the returned instance.
179+
*
180+
* The following fields are required:
181+
* ```kotlin
182+
* .httpClient()
183+
* .apiKey()
184+
* ```
185+
*
186+
* @throws IllegalStateException if any required field is unset.
187+
*/
175188
fun build(): ClientOptions {
176189
val httpClient = checkRequired("httpClient", httpClient)
177190
val apiKey = checkRequired("apiKey", apiKey)

onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/Timeout.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ private constructor(
117117
*/
118118
fun request(request: Duration?) = apply { this.request = request }
119119

120+
/**
121+
* Returns an immutable instance of [Timeout].
122+
*
123+
* Further updates to this [Builder] will not mutate the returned instance.
124+
*/
120125
fun build(): Timeout = Timeout(connect, read, write, request)
121126
}
122127

onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/OnebusawaySdkError.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ private constructor(
5858
keys.forEach(::removeAdditionalProperty)
5959
}
6060

61+
/**
62+
* Returns an immutable instance of [OnebusawaySdkError].
63+
*
64+
* Further updates to this [Builder] will not mutate the returned instance.
65+
*/
6166
fun build(): OnebusawaySdkError = OnebusawaySdkError(additionalProperties.toImmutable())
6267
}
6368

onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/models/AgenciesWithCoverageListParams.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ private constructor(
149149
additionalQueryParams.removeAll(keys)
150150
}
151151

152+
/**
153+
* Returns an immutable instance of [AgenciesWithCoverageListParams].
154+
*
155+
* Further updates to this [Builder] will not mutate the returned instance.
156+
*/
152157
fun build(): AgenciesWithCoverageListParams =
153158
AgenciesWithCoverageListParams(additionalHeaders.build(), additionalQueryParams.build())
154159
}

onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/models/AgenciesWithCoverageListResponse.kt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,22 @@ private constructor(
237237
keys.forEach(::removeAdditionalProperty)
238238
}
239239

240+
/**
241+
* Returns an immutable instance of [AgenciesWithCoverageListResponse].
242+
*
243+
* Further updates to this [Builder] will not mutate the returned instance.
244+
*
245+
* The following fields are required:
246+
* ```kotlin
247+
* .code()
248+
* .currentTime()
249+
* .text()
250+
* .version()
251+
* .data()
252+
* ```
253+
*
254+
* @throws IllegalStateException if any required field is unset.
255+
*/
240256
fun build(): AgenciesWithCoverageListResponse =
241257
AgenciesWithCoverageListResponse(
242258
checkRequired("code", code),
@@ -430,6 +446,20 @@ private constructor(
430446
keys.forEach(::removeAdditionalProperty)
431447
}
432448

449+
/**
450+
* Returns an immutable instance of [Data].
451+
*
452+
* Further updates to this [Builder] will not mutate the returned instance.
453+
*
454+
* The following fields are required:
455+
* ```kotlin
456+
* .limitExceeded()
457+
* .list()
458+
* .references()
459+
* ```
460+
*
461+
* @throws IllegalStateException if any required field is unset.
462+
*/
433463
fun build(): Data =
434464
Data(
435465
checkRequired("limitExceeded", limitExceeded),
@@ -667,6 +697,22 @@ private constructor(
667697
keys.forEach(::removeAdditionalProperty)
668698
}
669699

700+
/**
701+
* Returns an immutable instance of [List].
702+
*
703+
* Further updates to this [Builder] will not mutate the returned instance.
704+
*
705+
* The following fields are required:
706+
* ```kotlin
707+
* .agencyId()
708+
* .lat()
709+
* .latSpan()
710+
* .lon()
711+
* .lonSpan()
712+
* ```
713+
*
714+
* @throws IllegalStateException if any required field is unset.
715+
*/
670716
fun build(): List =
671717
List(
672718
checkRequired("agencyId", agencyId),

onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/models/AgencyRetrieveParams.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,18 @@ private constructor(
163163
additionalQueryParams.removeAll(keys)
164164
}
165165

166+
/**
167+
* Returns an immutable instance of [AgencyRetrieveParams].
168+
*
169+
* Further updates to this [Builder] will not mutate the returned instance.
170+
*
171+
* The following fields are required:
172+
* ```kotlin
173+
* .agencyId()
174+
* ```
175+
*
176+
* @throws IllegalStateException if any required field is unset.
177+
*/
166178
fun build(): AgencyRetrieveParams =
167179
AgencyRetrieveParams(
168180
checkRequired("agencyId", agencyId),

onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/models/AgencyRetrieveResponse.kt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,22 @@ private constructor(
233233
keys.forEach(::removeAdditionalProperty)
234234
}
235235

236+
/**
237+
* Returns an immutable instance of [AgencyRetrieveResponse].
238+
*
239+
* Further updates to this [Builder] will not mutate the returned instance.
240+
*
241+
* The following fields are required:
242+
* ```kotlin
243+
* .code()
244+
* .currentTime()
245+
* .text()
246+
* .version()
247+
* .data()
248+
* ```
249+
*
250+
* @throws IllegalStateException if any required field is unset.
251+
*/
236252
fun build(): AgencyRetrieveResponse =
237253
AgencyRetrieveResponse(
238254
checkRequired("code", code),
@@ -410,6 +426,20 @@ private constructor(
410426
keys.forEach(::removeAdditionalProperty)
411427
}
412428

429+
/**
430+
* Returns an immutable instance of [Data].
431+
*
432+
* Further updates to this [Builder] will not mutate the returned instance.
433+
*
434+
* The following fields are required:
435+
* ```kotlin
436+
* .entry()
437+
* .limitExceeded()
438+
* .references()
439+
* ```
440+
*
441+
* @throws IllegalStateException if any required field is unset.
442+
*/
413443
fun build(): Data =
414444
Data(
415445
checkRequired("entry", entry),
@@ -806,6 +836,21 @@ private constructor(
806836
keys.forEach(::removeAdditionalProperty)
807837
}
808838

839+
/**
840+
* Returns an immutable instance of [Entry].
841+
*
842+
* Further updates to this [Builder] will not mutate the returned instance.
843+
*
844+
* The following fields are required:
845+
* ```kotlin
846+
* .id()
847+
* .name()
848+
* .timezone()
849+
* .url()
850+
* ```
851+
*
852+
* @throws IllegalStateException if any required field is unset.
853+
*/
809854
fun build(): Entry =
810855
Entry(
811856
checkRequired("id", id),

onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/models/ArrivalAndDepartureListParams.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,18 @@ private constructor(
216216
additionalQueryParams.removeAll(keys)
217217
}
218218

219+
/**
220+
* Returns an immutable instance of [ArrivalAndDepartureListParams].
221+
*
222+
* Further updates to this [Builder] will not mutate the returned instance.
223+
*
224+
* The following fields are required:
225+
* ```kotlin
226+
* .stopId()
227+
* ```
228+
*
229+
* @throws IllegalStateException if any required field is unset.
230+
*/
219231
fun build(): ArrivalAndDepartureListParams =
220232
ArrivalAndDepartureListParams(
221233
checkRequired("stopId", stopId),

0 commit comments

Comments
 (0)