mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-23 00:59:25 +00:00
[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:
committed by
GitHub
parent
4fdc9197dd
commit
fdda9fc54c
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user