[Java] Replace if with ? in Generated toIndentedString-methods (#23209)

* [Java] Refactor `toIndentedString`-method to use `String::valueOf`

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Replace Conventional if-statment with Ternary Operator in `toIndentedString`-methods

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Generate `j*` Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Generate `spring*` Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Generate `java-*` Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Generate `java-*` Samples

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

---------

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>
This commit is contained in:
Christopher Molin
2026-03-17 05:30:52 +01:00
committed by GitHub
parent 4fdc9197dd
commit fdda9fc54c
4998 changed files with 4998 additions and 19992 deletions

View File

@@ -130,10 +130,7 @@ public class Bird {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -130,10 +130,7 @@ public class Category {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -182,10 +182,7 @@ public class DataQuery extends Query {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -466,10 +466,7 @@ public class DefaultValue {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -165,10 +165,7 @@ public class NumberPropertiesOnly {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -316,10 +316,7 @@ public class Pet {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -178,10 +178,7 @@ public class Query {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -130,10 +130,7 @@ public class Tag {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -99,10 +99,7 @@ public class TestFormObjectMultipartRequestMarker {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -195,10 +195,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**

View File

@@ -110,10 +110,7 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
/**