Skip to content

Commit 39abab6

Browse files
style(internal): move enum identity methods to bottom of class (#64)
1 parent ef2537a commit 39abab6

18 files changed

+266
-266
lines changed

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

+22-22
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,6 @@ constructor(
240240

241241
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
242242

243-
override fun equals(other: Any?): Boolean {
244-
if (this === other) {
245-
return true
246-
}
247-
248-
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
249-
}
250-
251-
override fun hashCode() = value.hashCode()
252-
253-
override fun toString() = value.toString()
254-
255243
companion object {
256244

257245
@JvmField val RUNNING = of("running")
@@ -305,27 +293,27 @@ constructor(
305293
}
306294

307295
fun asString(): String = _value().asStringOrThrow()
308-
}
309-
310-
class Type
311-
@JsonCreator
312-
private constructor(
313-
private val value: JsonField<String>,
314-
) : Enum {
315-
316-
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
317296

318297
override fun equals(other: Any?): Boolean {
319298
if (this === other) {
320299
return true
321300
}
322301

323-
return /* spotless:off */ other is Type && value == other.value /* spotless:on */
302+
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
324303
}
325304

326305
override fun hashCode() = value.hashCode()
327306

328307
override fun toString() = value.toString()
308+
}
309+
310+
class Type
311+
@JsonCreator
312+
private constructor(
313+
private val value: JsonField<String>,
314+
) : Enum {
315+
316+
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
329317

330318
companion object {
331319

@@ -380,6 +368,18 @@ constructor(
380368
}
381369

382370
fun asString(): String = _value().asStringOrThrow()
371+
372+
override fun equals(other: Any?): Boolean {
373+
if (this === other) {
374+
return true
375+
}
376+
377+
return /* spotless:off */ other is Type && value == other.value /* spotless:on */
378+
}
379+
380+
override fun hashCode() = value.hashCode()
381+
382+
override fun toString() = value.toString()
383383
}
384384

385385
override fun equals(other: Any?): Boolean {

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -391,18 +391,6 @@ private constructor(
391391

392392
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
393393

394-
override fun equals(other: Any?): Boolean {
395-
if (this === other) {
396-
return true
397-
}
398-
399-
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
400-
}
401-
402-
override fun hashCode() = value.hashCode()
403-
404-
override fun toString() = value.toString()
405-
406394
companion object {
407395

408396
@JvmField val RUNNING = of("running")
@@ -456,6 +444,18 @@ private constructor(
456444
}
457445

458446
fun asString(): String = _value().asStringOrThrow()
447+
448+
override fun equals(other: Any?): Boolean {
449+
if (this === other) {
450+
return true
451+
}
452+
453+
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
454+
}
455+
456+
override fun hashCode() = value.hashCode()
457+
458+
override fun toString() = value.toString()
459459
}
460460

461461
@JsonDeserialize(builder = Goal.Builder::class)

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,6 @@ private constructor(
9494

9595
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<Boolean> = value
9696

97-
override fun equals(other: Any?): Boolean {
98-
if (this === other) {
99-
return true
100-
}
101-
102-
return /* spotless:off */ other is Success && value == other.value /* spotless:on */
103-
}
104-
105-
override fun hashCode() = value.hashCode()
106-
107-
override fun toString() = value.toString()
108-
10997
companion object {
11098

11199
@JvmField val TRUE = of(true)
@@ -135,6 +123,18 @@ private constructor(
135123
}
136124

137125
fun asString(): String = _value().asStringOrThrow()
126+
127+
override fun equals(other: Any?): Boolean {
128+
if (this === other) {
129+
return true
130+
}
131+
132+
return /* spotless:off */ other is Success && value == other.value /* spotless:on */
133+
}
134+
135+
override fun hashCode() = value.hashCode()
136+
137+
override fun toString() = value.toString()
138138
}
139139

140140
override fun equals(other: Any?): Boolean {

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -478,18 +478,6 @@ private constructor(
478478

479479
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
480480

481-
override fun equals(other: Any?): Boolean {
482-
if (this === other) {
483-
return true
484-
}
485-
486-
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
487-
}
488-
489-
override fun hashCode() = value.hashCode()
490-
491-
override fun toString() = value.toString()
492-
493481
companion object {
494482

495483
@JvmField val QUEUED = of("queued")
@@ -549,6 +537,18 @@ private constructor(
549537
}
550538

551539
fun asString(): String = _value().asStringOrThrow()
540+
541+
override fun equals(other: Any?): Boolean {
542+
if (this === other) {
543+
return true
544+
}
545+
546+
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
547+
}
548+
549+
override fun hashCode() = value.hashCode()
550+
551+
override fun toString() = value.toString()
552552
}
553553

554554
override fun equals(other: Any?): Boolean {

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,6 @@ private constructor(
9393

9494
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<Boolean> = value
9595

96-
override fun equals(other: Any?): Boolean {
97-
if (this === other) {
98-
return true
99-
}
100-
101-
return /* spotless:off */ other is Success && value == other.value /* spotless:on */
102-
}
103-
104-
override fun hashCode() = value.hashCode()
105-
106-
override fun toString() = value.toString()
107-
10896
companion object {
10997

11098
@JvmField val TRUE = of(true)
@@ -134,6 +122,18 @@ private constructor(
134122
}
135123

136124
fun asString(): String = _value().asStringOrThrow()
125+
126+
override fun equals(other: Any?): Boolean {
127+
if (this === other) {
128+
return true
129+
}
130+
131+
return /* spotless:off */ other is Success && value == other.value /* spotless:on */
132+
}
133+
134+
override fun hashCode() = value.hashCode()
135+
136+
override fun toString() = value.toString()
137137
}
138138

139139
override fun equals(other: Any?): Boolean {

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

+22-22
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,6 @@ constructor(
233233

234234
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
235235

236-
override fun equals(other: Any?): Boolean {
237-
if (this === other) {
238-
return true
239-
}
240-
241-
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
242-
}
243-
244-
override fun hashCode() = value.hashCode()
245-
246-
override fun toString() = value.toString()
247-
248236
companion object {
249237

250238
@JvmField val RUNNING = of("running")
@@ -298,27 +286,27 @@ constructor(
298286
}
299287

300288
fun asString(): String = _value().asStringOrThrow()
301-
}
302-
303-
class Type
304-
@JsonCreator
305-
private constructor(
306-
private val value: JsonField<String>,
307-
) : Enum {
308-
309-
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
310289

311290
override fun equals(other: Any?): Boolean {
312291
if (this === other) {
313292
return true
314293
}
315294

316-
return /* spotless:off */ other is Type && value == other.value /* spotless:on */
295+
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
317296
}
318297

319298
override fun hashCode() = value.hashCode()
320299

321300
override fun toString() = value.toString()
301+
}
302+
303+
class Type
304+
@JsonCreator
305+
private constructor(
306+
private val value: JsonField<String>,
307+
) : Enum {
308+
309+
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
322310

323311
companion object {
324312

@@ -373,6 +361,18 @@ constructor(
373361
}
374362

375363
fun asString(): String = _value().asStringOrThrow()
364+
365+
override fun equals(other: Any?): Boolean {
366+
if (this === other) {
367+
return true
368+
}
369+
370+
return /* spotless:off */ other is Type && value == other.value /* spotless:on */
371+
}
372+
373+
override fun hashCode() = value.hashCode()
374+
375+
override fun toString() = value.toString()
376376
}
377377

378378
override fun equals(other: Any?): Boolean {

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -393,18 +393,6 @@ private constructor(
393393

394394
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
395395

396-
override fun equals(other: Any?): Boolean {
397-
if (this === other) {
398-
return true
399-
}
400-
401-
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
402-
}
403-
404-
override fun hashCode() = value.hashCode()
405-
406-
override fun toString() = value.toString()
407-
408396
companion object {
409397

410398
@JvmField val RUNNING = of("running")
@@ -458,6 +446,18 @@ private constructor(
458446
}
459447

460448
fun asString(): String = _value().asStringOrThrow()
449+
450+
override fun equals(other: Any?): Boolean {
451+
if (this === other) {
452+
return true
453+
}
454+
455+
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
456+
}
457+
458+
override fun hashCode() = value.hashCode()
459+
460+
override fun toString() = value.toString()
461461
}
462462

463463
@JsonDeserialize(builder = Goal.Builder::class)

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -477,18 +477,6 @@ private constructor(
477477

478478
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
479479

480-
override fun equals(other: Any?): Boolean {
481-
if (this === other) {
482-
return true
483-
}
484-
485-
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
486-
}
487-
488-
override fun hashCode() = value.hashCode()
489-
490-
override fun toString() = value.toString()
491-
492480
companion object {
493481

494482
@JvmField val QUEUED = of("queued")
@@ -548,6 +536,18 @@ private constructor(
548536
}
549537

550538
fun asString(): String = _value().asStringOrThrow()
539+
540+
override fun equals(other: Any?): Boolean {
541+
if (this === other) {
542+
return true
543+
}
544+
545+
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
546+
}
547+
548+
override fun hashCode() = value.hashCode()
549+
550+
override fun toString() = value.toString()
551551
}
552552

553553
override fun equals(other: Any?): Boolean {

0 commit comments

Comments
 (0)