Skip to content

Commit 7d310f0

Browse files
committed
chore: regenerate samples
1 parent 54bb60e commit 7d310f0

207 files changed

Lines changed: 3322 additions & 745 deletions

File tree

Some content is hidden

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

samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/StringEnumRef.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
import com.fasterxml.jackson.annotation.JsonCreator;
2525
import com.fasterxml.jackson.annotation.JsonValue;
26+
import java.util.HashMap;
27+
import java.util.Map;
2628

2729
/**
2830
* Gets or Sets StringEnumRef
@@ -35,8 +37,19 @@ public enum StringEnumRef {
3537

3638
UNCLASSIFIED("unclassified");
3739

40+
private static final Map<String, StringEnumRef> cacheByValue = new HashMap<>();
41+
3842
private String value;
3943

44+
static {
45+
for (StringEnumRef e: values()) {
46+
String key = e.value;
47+
if (!cacheByValue.containsKey(key)) {
48+
cacheByValue.put(key, e);
49+
}
50+
}
51+
}
52+
4053
StringEnumRef(String value) {
4154
this.value = value;
4255
}
@@ -53,10 +66,9 @@ public String toString() {
5366

5467
@JsonCreator
5568
public static StringEnumRef fromValue(String value) {
56-
for (StringEnumRef b : StringEnumRef.values()) {
57-
if (b.value.equals(value)) {
58-
return b;
59-
}
69+
StringEnumRef result = cacheByValue.get(value);
70+
if (result != null) {
71+
return result;
6072
}
6173
throw new IllegalArgumentException("Unexpected value '" + value + "'");
6274
}

samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/StringEnumRef.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import com.google.gson.annotations.JsonAdapter;
2323
import com.google.gson.stream.JsonReader;
2424
import com.google.gson.stream.JsonWriter;
25+
import java.util.HashMap;
26+
import java.util.Map;
2527

2628
/**
2729
* Gets or Sets StringEnumRef
@@ -35,8 +37,19 @@ public enum StringEnumRef {
3537

3638
UNCLASSIFIED("unclassified");
3739

40+
private static final Map<String, StringEnumRef> cacheByValue = new HashMap<>();
41+
3842
private String value;
3943

44+
static {
45+
for (StringEnumRef e: values()) {
46+
String key = e.value;
47+
if (!cacheByValue.containsKey(key)) {
48+
cacheByValue.put(key, e);
49+
}
50+
}
51+
}
52+
4053
StringEnumRef(String value) {
4154
this.value = value;
4255
}
@@ -51,10 +64,9 @@ public String toString() {
5164
}
5265

5366
public static StringEnumRef fromValue(String value) {
54-
for (StringEnumRef b : StringEnumRef.values()) {
55-
if (b.value.equals(value)) {
56-
return b;
57-
}
67+
StringEnumRef result = cacheByValue.get(value);
68+
if (result != null) {
69+
return result;
5870
}
5971
throw new IllegalArgumentException("Unexpected value '" + value + "'");
6072
}

samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/StringEnumRef.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
import com.fasterxml.jackson.annotation.JsonCreator;
2626
import com.fasterxml.jackson.annotation.JsonValue;
27+
import java.util.HashMap;
28+
import java.util.Map;
2729

2830
/**
2931
* Gets or Sets StringEnumRef
@@ -36,8 +38,19 @@ public enum StringEnumRef {
3638

3739
UNCLASSIFIED("unclassified");
3840

41+
private static final Map<String, StringEnumRef> cacheByValue = new HashMap<>();
42+
3943
private String value;
4044

45+
static {
46+
for (StringEnumRef e: values()) {
47+
String key = e.value;
48+
if (!cacheByValue.containsKey(key)) {
49+
cacheByValue.put(key, e);
50+
}
51+
}
52+
}
53+
4154
StringEnumRef(String value) {
4255
this.value = value;
4356
}
@@ -54,10 +67,9 @@ public String toString() {
5467

5568
@JsonCreator
5669
public static StringEnumRef fromValue(String value) {
57-
for (StringEnumRef b : StringEnumRef.values()) {
58-
if (b.value.equals(value)) {
59-
return b;
60-
}
70+
StringEnumRef result = cacheByValue.get(value);
71+
if (result != null) {
72+
return result;
6173
}
6274
throw new IllegalArgumentException("Unexpected value '" + value + "'");
6375
}

samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/StringEnumRef.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import com.google.gson.annotations.SerializedName;
1818

1919
import java.io.IOException;
20+
import java.util.HashMap;
21+
import java.util.Map;
2022
import com.google.gson.TypeAdapter;
2123
import com.google.gson.JsonElement;
2224
import com.google.gson.annotations.JsonAdapter;
@@ -35,8 +37,19 @@ public enum StringEnumRef {
3537

3638
UNCLASSIFIED("unclassified");
3739

40+
private static final Map<String, StringEnumRef> cacheByValue = new HashMap<>();
41+
3842
private String value;
3943

44+
static {
45+
for (StringEnumRef e: values()) {
46+
String key = e.value;
47+
if (!cacheByValue.containsKey(key)) {
48+
cacheByValue.put(key, e);
49+
}
50+
}
51+
}
52+
4053
StringEnumRef(String value) {
4154
this.value = value;
4255
}
@@ -51,10 +64,9 @@ public String toString() {
5164
}
5265

5366
public static StringEnumRef fromValue(String value) {
54-
for (StringEnumRef b : StringEnumRef.values()) {
55-
if (b.value.equals(value)) {
56-
return b;
57-
}
67+
StringEnumRef result = cacheByValue.get(value);
68+
if (result != null) {
69+
return result;
5870
}
5971
throw new IllegalArgumentException("Unexpected value '" + value + "'");
6072
}

samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/StringEnumRef.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
import com.fasterxml.jackson.annotation.JsonCreator;
2323
import com.fasterxml.jackson.annotation.JsonValue;
24+
import java.util.HashMap;
25+
import java.util.Map;
2426

2527
/**
2628
* Gets or Sets StringEnumRef
@@ -33,8 +35,19 @@ public enum StringEnumRef {
3335

3436
UNCLASSIFIED("unclassified");
3537

38+
private static final Map<String, StringEnumRef> cacheByValue = new HashMap<>();
39+
3640
private String value;
3741

42+
static {
43+
for (StringEnumRef e: values()) {
44+
String key = e.value;
45+
if (!cacheByValue.containsKey(key)) {
46+
cacheByValue.put(key, e);
47+
}
48+
}
49+
}
50+
3851
StringEnumRef(String value) {
3952
this.value = value;
4053
}
@@ -51,10 +64,9 @@ public String toString() {
5164

5265
@JsonCreator
5366
public static StringEnumRef fromValue(String value) {
54-
for (StringEnumRef b : StringEnumRef.values()) {
55-
if (b.value.equals(value)) {
56-
return b;
57-
}
67+
StringEnumRef result = cacheByValue.get(value);
68+
if (result != null) {
69+
return result;
5870
}
5971
throw new IllegalArgumentException("Unexpected value '" + value + "'");
6072
}

samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/StringEnumRef.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import com.fasterxml.jackson.annotation.JsonCreator;
2222
import com.fasterxml.jackson.annotation.JsonValue;
23+
import java.util.HashMap;
24+
import java.util.Map;
2325

2426
/**
2527
* Gets or Sets StringEnumRef
@@ -32,8 +34,19 @@ public enum StringEnumRef {
3234

3335
UNCLASSIFIED("unclassified");
3436

37+
private static final Map<String, StringEnumRef> cacheByValue = new HashMap<>();
38+
3539
private String value;
3640

41+
static {
42+
for (StringEnumRef e: values()) {
43+
String key = e.value;
44+
if (!cacheByValue.containsKey(key)) {
45+
cacheByValue.put(key, e);
46+
}
47+
}
48+
}
49+
3750
StringEnumRef(String value) {
3851
this.value = value;
3952
}
@@ -50,10 +63,9 @@ public String toString() {
5063

5164
@JsonCreator
5265
public static StringEnumRef fromValue(String value) {
53-
for (StringEnumRef b : StringEnumRef.values()) {
54-
if (b.value.equals(value)) {
55-
return b;
56-
}
66+
StringEnumRef result = cacheByValue.get(value);
67+
if (result != null) {
68+
return result;
5769
}
5870
throw new IllegalArgumentException("Unexpected value '" + value + "'");
5971
}

samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/StringEnumRef.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
import com.fasterxml.jackson.annotation.JsonCreator;
2323
import com.fasterxml.jackson.annotation.JsonValue;
24+
import java.util.HashMap;
25+
import java.util.Map;
2426

2527
/**
2628
* Gets or Sets StringEnumRef
@@ -33,8 +35,19 @@ public enum StringEnumRef {
3335

3436
UNCLASSIFIED("unclassified");
3537

38+
private static final Map<String, StringEnumRef> cacheByValue = new HashMap<>();
39+
3640
private String value;
3741

42+
static {
43+
for (StringEnumRef e: values()) {
44+
String key = e.value;
45+
if (!cacheByValue.containsKey(key)) {
46+
cacheByValue.put(key, e);
47+
}
48+
}
49+
}
50+
3851
StringEnumRef(String value) {
3952
this.value = value;
4053
}
@@ -51,10 +64,9 @@ public String toString() {
5164

5265
@JsonCreator
5366
public static StringEnumRef fromValue(String value) {
54-
for (StringEnumRef b : StringEnumRef.values()) {
55-
if (b.value.equals(value)) {
56-
return b;
57-
}
67+
StringEnumRef result = cacheByValue.get(value);
68+
if (result != null) {
69+
return result;
5870
}
5971
throw new IllegalArgumentException("Unexpected value '" + value + "'");
6072
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.20.0-SNAPSHOT
1+
7.21.0-SNAPSHOT

samples/client/echo_api/kotlin-jvm-okhttp-multipart-json/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
77

88
- API version: 1.0.0
99
- Package version:
10-
- Generator version: 7.20.0-SNAPSHOT
10+
- Generator version: 7.21.0-SNAPSHOT
1111
- Build package: org.openapitools.codegen.languages.KotlinClientCodegen
1212

1313
## Requires

samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/DataChannel.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
import com.fasterxml.jackson.annotation.JsonCreator;
2323
import com.fasterxml.jackson.annotation.JsonValue;
24+
import java.util.HashMap;
25+
import java.util.Map;
2426

2527
/**
2628
* The transport-channel
@@ -35,8 +37,19 @@ public enum DataChannel {
3537

3638
PLANE("PLANE");
3739

40+
private static final Map<String, DataChannel> cacheByValue = new HashMap<>();
41+
3842
private String value;
3943

44+
static {
45+
for (DataChannel e: values()) {
46+
String key = e.value;
47+
if (!cacheByValue.containsKey(key)) {
48+
cacheByValue.put(key, e);
49+
}
50+
}
51+
}
52+
4053
DataChannel(String value) {
4154
this.value = value;
4255
}
@@ -53,10 +66,9 @@ public String toString() {
5366

5467
@JsonCreator
5568
public static DataChannel fromValue(String value) {
56-
for (DataChannel b : DataChannel.values()) {
57-
if (b.value.equals(value)) {
58-
return b;
59-
}
69+
DataChannel result = cacheByValue.get(value);
70+
if (result != null) {
71+
return result;
6072
}
6173
throw new IllegalArgumentException("Unexpected value '" + value + "'");
6274
}

0 commit comments

Comments
 (0)