Skip to content

Commit

Permalink
improve java enums (#19815)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-mfg authored Oct 9, 2024
1 parent 22b8c47 commit d60200d
Show file tree
Hide file tree
Showing 193 changed files with 761 additions and 761 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{#withXml}}
@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}})
{{/withXml}}
{{{name}}}({{{value}}}){{^-last}},
{{{name}}}({{^isUri}}{{dataType}}.valueOf({{/isUri}}{{{value}}}{{^isUri}}){{/isUri}}){{^-last}},
{{/-last}}{{#-last}};{{/-last}}
{{/enumVars}}
{{/allowableValues}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public class DefaultValue {
* Gets or Sets arrayStringEnumDefault
*/
public enum ArrayStringEnumDefaultEnum {
SUCCESS("success"),
SUCCESS(String.valueOf("success")),

FAILURE("failure"),
FAILURE(String.valueOf("failure")),

UNCLASSIFIED("unclassified");
UNCLASSIFIED(String.valueOf("unclassified"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public class Pet {
* pet status in the store
*/
public enum StatusEnum {
AVAILABLE("available"),
AVAILABLE(String.valueOf("available")),

PENDING("pending"),
PENDING(String.valueOf("pending")),

SOLD("sold");
SOLD(String.valueOf("sold"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public class Query {
* Gets or Sets outcomes
*/
public enum OutcomesEnum {
SUCCESS("SUCCESS"),
SUCCESS(String.valueOf("SUCCESS")),

FAILURE("FAILURE"),
FAILURE(String.valueOf("FAILURE")),

SKIPPED("SKIPPED");
SKIPPED(String.valueOf("SKIPPED"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ public class DefaultValue {
*/
@JsonAdapter(ArrayStringEnumDefaultEnum.Adapter.class)
public enum ArrayStringEnumDefaultEnum {
SUCCESS("success"),
SUCCESS(String.valueOf("success")),

FAILURE("failure"),
FAILURE(String.valueOf("failure")),

UNCLASSIFIED("unclassified");
UNCLASSIFIED(String.valueOf("unclassified"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public class Pet {
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
AVAILABLE("available"),
AVAILABLE(String.valueOf("available")),

PENDING("pending"),
PENDING(String.valueOf("pending")),

SOLD("sold");
SOLD(String.valueOf("sold"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public class Query {
*/
@JsonAdapter(OutcomesEnum.Adapter.class)
public enum OutcomesEnum {
SUCCESS("SUCCESS"),
SUCCESS(String.valueOf("SUCCESS")),

FAILURE("FAILURE"),
FAILURE(String.valueOf("FAILURE")),

SKIPPED("SKIPPED");
SKIPPED(String.valueOf("SKIPPED"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public class DefaultValue {
* Gets or Sets arrayStringEnumDefault
*/
public enum ArrayStringEnumDefaultEnum {
SUCCESS("success"),
SUCCESS(String.valueOf("success")),

FAILURE("failure"),
FAILURE(String.valueOf("failure")),

UNCLASSIFIED("unclassified");
UNCLASSIFIED(String.valueOf("unclassified"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ public class Pet {
* pet status in the store
*/
public enum StatusEnum {
AVAILABLE("available"),
AVAILABLE(String.valueOf("available")),

PENDING("pending"),
PENDING(String.valueOf("pending")),

SOLD("sold");
SOLD(String.valueOf("sold"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public class Query {
* Gets or Sets outcomes
*/
public enum OutcomesEnum {
SUCCESS("SUCCESS"),
SUCCESS(String.valueOf("SUCCESS")),

FAILURE("FAILURE"),
FAILURE(String.valueOf("FAILURE")),

SKIPPED("SKIPPED");
SKIPPED(String.valueOf("SKIPPED"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public class DefaultValue {
* Gets or Sets arrayStringEnumDefault
*/
public enum ArrayStringEnumDefaultEnum {
SUCCESS("success"),
SUCCESS(String.valueOf("success")),

FAILURE("failure"),
FAILURE(String.valueOf("failure")),

UNCLASSIFIED("unclassified");
UNCLASSIFIED(String.valueOf("unclassified"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public class Pet {
* pet status in the store
*/
public enum StatusEnum {
AVAILABLE("available"),
AVAILABLE(String.valueOf("available")),

PENDING("pending"),
PENDING(String.valueOf("pending")),

SOLD("sold");
SOLD(String.valueOf("sold"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public class Query {
* Gets or Sets outcomes
*/
public enum OutcomesEnum {
SUCCESS("SUCCESS"),
SUCCESS(String.valueOf("SUCCESS")),

FAILURE("FAILURE"),
FAILURE(String.valueOf("FAILURE")),

SKIPPED("SKIPPED");
SKIPPED(String.valueOf("SKIPPED"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public class DefaultValue {
* Gets or Sets arrayStringEnumDefault
*/
public enum ArrayStringEnumDefaultEnum {
SUCCESS("success"),
SUCCESS(String.valueOf("success")),

FAILURE("failure"),
FAILURE(String.valueOf("failure")),

UNCLASSIFIED("unclassified");
UNCLASSIFIED(String.valueOf("unclassified"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public class Pet {
* pet status in the store
*/
public enum StatusEnum {
AVAILABLE("available"),
AVAILABLE(String.valueOf("available")),

PENDING("pending"),
PENDING(String.valueOf("pending")),

SOLD("sold");
SOLD(String.valueOf("sold"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public class Query {
* Gets or Sets outcomes
*/
public enum OutcomesEnum {
SUCCESS("SUCCESS"),
SUCCESS(String.valueOf("SUCCESS")),

FAILURE("FAILURE"),
FAILURE(String.valueOf("FAILURE")),

SKIPPED("SKIPPED");
SKIPPED(String.valueOf("SKIPPED"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public class DefaultValue {
* Gets or Sets arrayStringEnumDefault
*/
public enum ArrayStringEnumDefaultEnum {
SUCCESS("success"),
SUCCESS(String.valueOf("success")),

FAILURE("failure"),
FAILURE(String.valueOf("failure")),

UNCLASSIFIED("unclassified");
UNCLASSIFIED(String.valueOf("unclassified"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public class Pet {
* pet status in the store
*/
public enum StatusEnum {
AVAILABLE("available"),
AVAILABLE(String.valueOf("available")),

PENDING("pending"),
PENDING(String.valueOf("pending")),

SOLD("sold");
SOLD(String.valueOf("sold"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public class Query {
* Gets or Sets outcomes
*/
public enum OutcomesEnum {
SUCCESS("SUCCESS"),
SUCCESS(String.valueOf("SUCCESS")),

FAILURE("FAILURE"),
FAILURE(String.valueOf("FAILURE")),

SKIPPED("SKIPPED");
SKIPPED(String.valueOf("SKIPPED"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public class EnumArrays {
* Gets or Sets justSymbol
*/
public enum JustSymbolEnum {
GREATER_THAN_OR_EQUAL_TO(">="),
GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")),

DOLLAR("$");
DOLLAR(String.valueOf("$"));

private String value;

Expand Down Expand Up @@ -80,9 +80,9 @@ public static JustSymbolEnum fromValue(String value) {
* Gets or Sets arrayEnum
*/
public enum ArrayEnumEnum {
FISH("fish"),
FISH(String.valueOf("fish")),

CRAB("crab");
CRAB(String.valueOf("crab"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public class EnumTest {
* Gets or Sets enumString
*/
public enum EnumStringEnum {
UPPER("UPPER"),
UPPER(String.valueOf("UPPER")),

LOWER("lower"),
LOWER(String.valueOf("lower")),

EMPTY("");
EMPTY(String.valueOf(""));

private String value;

Expand Down Expand Up @@ -94,11 +94,11 @@ public static EnumStringEnum fromValue(String value) {
* Gets or Sets enumStringRequired
*/
public enum EnumStringRequiredEnum {
UPPER("UPPER"),
UPPER(String.valueOf("UPPER")),

LOWER("lower"),
LOWER(String.valueOf("lower")),

EMPTY("");
EMPTY(String.valueOf(""));

private String value;

Expand Down Expand Up @@ -134,9 +134,9 @@ public static EnumStringRequiredEnum fromValue(String value) {
* Gets or Sets enumInteger
*/
public enum EnumIntegerEnum {
NUMBER_1(1),
NUMBER_1(Integer.valueOf(1)),

NUMBER_MINUS_1(-1);
NUMBER_MINUS_1(Integer.valueOf(-1));

private Integer value;

Expand Down Expand Up @@ -172,9 +172,9 @@ public static EnumIntegerEnum fromValue(Integer value) {
* Gets or Sets enumNumber
*/
public enum EnumNumberEnum {
NUMBER_1_DOT_1(1.1),
NUMBER_1_DOT_1(Double.valueOf(1.1)),

NUMBER_MINUS_1_DOT_2(-1.2);
NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));

private Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public class MapTest {
* Gets or Sets inner
*/
public enum InnerEnum {
UPPER("UPPER"),
UPPER(String.valueOf("UPPER")),

LOWER("lower");
LOWER(String.valueOf("lower"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public class Order {
* Order Status
*/
public enum StatusEnum {
PLACED("placed"),
PLACED(String.valueOf("placed")),

APPROVED("approved"),
APPROVED(String.valueOf("approved")),

DELIVERED("delivered");
DELIVERED(String.valueOf("delivered"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class ParentWithNullable {
* Gets or Sets type
*/
public enum TypeEnum {
CHILD_WITH_NULLABLE("ChildWithNullable");
CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable"));

private String value;

Expand Down
Loading

0 comments on commit d60200d

Please sign in to comment.