|
| 1 | +/** |
| 2 | + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} |
| 3 | + * @deprecated{{/isDeprecated}} |
| 4 | + */ |
| 5 | +{{>additionalModelTypeAnnotations}} |
| 6 | +{{#description}} |
| 7 | +{{#isDeprecated}} |
| 8 | +@Deprecated |
| 9 | +{{/isDeprecated}} |
| 10 | +{{#swagger1AnnotationLibrary}} |
| 11 | +@ApiModel(description = "{{{description}}}") |
| 12 | +{{/swagger1AnnotationLibrary}} |
| 13 | +{{#swagger2AnnotationLibrary}} |
| 14 | +@Schema({{#name}}name = "{{name}}", {{/name}}description = "{{{description}}}"{{#deprecated}}, deprecated = true{{/deprecated}}) |
| 15 | +{{/swagger2AnnotationLibrary}} |
| 16 | +{{/description}} |
| 17 | +{{#discriminator}} |
| 18 | +{{>typeInfoAnnotation}} |
| 19 | +{{/discriminator}} |
| 20 | +{{#jackson}} |
| 21 | +{{#isClassnameSanitized}} |
| 22 | +{{^hasDiscriminatorWithNonEmptyMapping}} |
| 23 | +@JsonTypeName("{{name}}") |
| 24 | +{{/hasDiscriminatorWithNonEmptyMapping}} |
| 25 | +{{/isClassnameSanitized}} |
| 26 | +{{/jackson}} |
| 27 | +{{#withXml}} |
| 28 | +{{>xmlAnnotation}} |
| 29 | +{{/withXml}} |
| 30 | +{{>generatedAnnotation}} |
| 31 | +{{#vendorExtensions.x-class-extra-annotation}} |
| 32 | +{{{vendorExtensions.x-class-extra-annotation}}} |
| 33 | +{{/vendorExtensions.x-class-extra-annotation}} |
| 34 | +public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}{{#hateoas}} extends RepresentationModel<{{classname}}> {{/hateoas}}{{/parent}}{{#vendorExtensions.x-implements}}{{#-first}} implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { |
| 35 | +{{#serializableModel}} |
| 36 | + |
| 37 | + private static final long serialVersionUID = 1L; |
| 38 | +{{/serializableModel}} |
| 39 | + {{#vars}} |
| 40 | + |
| 41 | + {{#isEnum}} |
| 42 | + {{^isContainer}} |
| 43 | +{{>enumClass}} |
| 44 | + {{/isContainer}} |
| 45 | + {{#isContainer}} |
| 46 | + {{#mostInnerItems}} |
| 47 | +{{>enumClass}} |
| 48 | + {{/mostInnerItems}} |
| 49 | + {{/isContainer}} |
| 50 | + {{/isEnum}} |
| 51 | + {{#gson}} |
| 52 | + @SerializedName("{{baseName}}") |
| 53 | + {{/gson}} |
| 54 | + {{#lombok.RequiredArgsConstructor}} |
| 55 | + {{^useBeanValidation}} |
| 56 | + {{#required}} |
| 57 | + @lombok.NonNull |
| 58 | + {{/required}} |
| 59 | + {{/useBeanValidation}} |
| 60 | + {{/lombok.RequiredArgsConstructor}} |
| 61 | + {{#lombok.ToString}} |
| 62 | + {{#isPassword}} |
| 63 | + @lombok.ToString.Exclude |
| 64 | + {{/isPassword}} |
| 65 | + {{/lombok.ToString}} |
| 66 | + {{#vendorExtensions.x-field-extra-annotation}} |
| 67 | + {{{vendorExtensions.x-field-extra-annotation}}} |
| 68 | + {{/vendorExtensions.x-field-extra-annotation}} |
| 69 | + {{#deprecated}} |
| 70 | + @Deprecated |
| 71 | + {{/deprecated}} |
| 72 | + {{#isContainer}} |
| 73 | + {{#useBeanValidation}}@Valid{{/useBeanValidation}} |
| 74 | + {{#openApiNullable}} |
| 75 | + private {{#isNullable}}{{>nullableDataTypeBeanValidation}} {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined();{{/isNullable}}{{^required}}{{^isNullable}}{{>nullableDataTypeBeanValidation}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/isNullable}}{{/required}}{{#required}}{{^isNullable}}{{>nullableDataTypeBeanValidation}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/isNullable}}{{/required}} |
| 76 | + {{/openApiNullable}} |
| 77 | + {{^openApiNullable}} |
| 78 | + private {{>nullableDataType}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; |
| 79 | + {{/openApiNullable}} |
| 80 | + {{/isContainer}} |
| 81 | + {{^isContainer}} |
| 82 | + {{#isDate}} |
| 83 | + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) |
| 84 | + {{/isDate}} |
| 85 | + {{#isDateTime}} |
| 86 | + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) |
| 87 | + {{/isDateTime}} |
| 88 | + {{#openApiNullable}} |
| 89 | + private {{#isNullable}}{{>nullableDataTypeBeanValidation}} {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined();{{/isNullable}}{{^required}}{{^isNullable}}{{>nullableDataTypeBeanValidation}} {{name}}{{#useOptional}} = Optional.{{^defaultValue}}empty(){{/defaultValue}}{{#defaultValue}}of({{{.}}}){{/defaultValue}};{{/useOptional}}{{^useOptional}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/useOptional}}{{/isNullable}}{{/required}}{{^isNullable}}{{#required}}{{>nullableDataTypeBeanValidation}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/required}}{{/isNullable}} |
| 90 | + {{/openApiNullable}} |
| 91 | + {{^openApiNullable}} |
| 92 | + private {{>nullableDataType}} {{name}}{{#isNullable}} = null{{/isNullable}}{{^isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isNullable}}; |
| 93 | + {{/openApiNullable}} |
| 94 | + {{/isContainer}} |
| 95 | + {{/vars}} |
| 96 | + {{#vendorExtensions.x-java-no-args-constructor}} |
| 97 | + |
| 98 | + public {{classname}}() { |
| 99 | + super(); |
| 100 | + } |
| 101 | + {{/vendorExtensions.x-java-no-args-constructor}} |
| 102 | + {{^lombok.Data}} |
| 103 | + {{^lombok.RequiredArgsConstructor}} |
| 104 | + {{#generatedConstructorWithRequiredArgs}} |
| 105 | + {{#hasRequired}} |
| 106 | + |
| 107 | + /** |
| 108 | + * Constructor with only required parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}} |
| 109 | + */ |
| 110 | + public {{classname}}({{#requiredVars}}{{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/requiredVars}}) { |
| 111 | + {{#parent}} |
| 112 | + super({{#parentRequiredVars}}{{name}}{{^-last}}, {{/-last}}{{/parentRequiredVars}}); |
| 113 | + {{/parent}} |
| 114 | + {{#vars}} |
| 115 | + {{#required}} |
| 116 | + {{#openApiNullable}} |
| 117 | + this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}Optional.ofNullable({{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}{{name}}{{#isNullable}}){{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}){{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}; |
| 118 | + {{/openApiNullable}} |
| 119 | + {{^openApiNullable}} |
| 120 | + this.{{name}} = {{name}}; |
| 121 | + {{/openApiNullable}} |
| 122 | + {{/required}} |
| 123 | + {{/vars}} |
| 124 | + } |
| 125 | + {{/hasRequired}} |
| 126 | + {{/generatedConstructorWithRequiredArgs}} |
| 127 | + {{/lombok.RequiredArgsConstructor}} |
| 128 | + {{#vendorExtensions.x-java-all-args-constructor}} |
| 129 | + |
| 130 | + /** |
| 131 | + * Constructor with all args parameters |
| 132 | + */ |
| 133 | + public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) { |
| 134 | + {{#parent}} |
| 135 | + super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}}); |
| 136 | + {{/parent}} |
| 137 | + {{#vars}} |
| 138 | + {{#openApiNullable}} |
| 139 | + this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}Optional.ofNullable({{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}{{name}}{{#isNullable}}){{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}){{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}; |
| 140 | + {{/openApiNullable}} |
| 141 | + {{^openApiNullable}} |
| 142 | + this.{{name}} = {{name}}; |
| 143 | + {{/openApiNullable}} |
| 144 | + {{/vars}} |
| 145 | + } |
| 146 | + {{/vendorExtensions.x-java-all-args-constructor}} |
| 147 | + {{/lombok.Data}} |
| 148 | + {{#vars}} |
| 149 | + {{^lombok.Data}} |
| 150 | + |
| 151 | + {{! begin feature: fluent setter methods }} |
| 152 | + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { |
| 153 | + {{#openApiNullable}} |
| 154 | + this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}Optional.of({{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}{{name}}{{#isNullable}}){{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}){{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}; |
| 155 | + {{/openApiNullable}} |
| 156 | + {{^openApiNullable}} |
| 157 | + this.{{name}} = {{name}}; |
| 158 | + {{/openApiNullable}} |
| 159 | + return this; |
| 160 | + } |
| 161 | + {{#isArray}} |
| 162 | + |
| 163 | + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { |
| 164 | + {{#openApiNullable}} |
| 165 | + if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) { |
| 166 | + this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}{{#isNullable}}){{/isNullable}}; |
| 167 | + } |
| 168 | + this.{{name}}{{#isNullable}}.get(){{/isNullable}}.add({{name}}Item); |
| 169 | + {{/openApiNullable}} |
| 170 | + {{^openApiNullable}} |
| 171 | + if (this.{{name}} == null) { |
| 172 | + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; |
| 173 | + } |
| 174 | + this.{{name}}.add({{name}}Item); |
| 175 | + {{/openApiNullable}} |
| 176 | + return this; |
| 177 | + } |
| 178 | + {{/isArray}} |
| 179 | + {{#isMap}} |
| 180 | + |
| 181 | + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { |
| 182 | + {{#openApiNullable}} |
| 183 | + if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) { |
| 184 | + this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}HashMap{{/uniqueItems}}<>(){{/defaultValue}}{{#isNullable}}){{/isNullable}}; |
| 185 | + } |
| 186 | + this.{{name}}{{#isNullable}}.get(){{/isNullable}}.put(key, {{name}}Item); |
| 187 | + {{/openApiNullable}} |
| 188 | + {{^openApiNullable}} |
| 189 | + if (this.{{name}} == null) { |
| 190 | + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}HashMap{{/uniqueItems}}<>(){{/defaultValue}}; |
| 191 | + } |
| 192 | + this.{{name}}.put(key, {{name}}Item); |
| 193 | + {{/openApiNullable}} |
| 194 | + return this; |
| 195 | + } |
| 196 | + {{/isMap}} |
| 197 | + {{! end feature: fluent setter methods }} |
| 198 | + {{! begin feature: getter and setter }} |
| 199 | + {{^lombok.Getter}} |
| 200 | + |
| 201 | + /** |
| 202 | + {{#description}} |
| 203 | + * {{{.}}} |
| 204 | + {{/description}} |
| 205 | + {{^description}} |
| 206 | + * Get {{name}} |
| 207 | + {{/description}} |
| 208 | + {{#minimum}} |
| 209 | + * minimum: {{.}} |
| 210 | + {{/minimum}} |
| 211 | + {{#maximum}} |
| 212 | + * maximum: {{.}} |
| 213 | + {{/maximum}} |
| 214 | + * @return {{name}} |
| 215 | + {{#deprecated}} |
| 216 | + * @deprecated |
| 217 | + {{/deprecated}} |
| 218 | + */ |
| 219 | + {{#vendorExtensions.x-extra-annotation}} |
| 220 | + {{{vendorExtensions.x-extra-annotation}}} |
| 221 | + {{/vendorExtensions.x-extra-annotation}} |
| 222 | + {{#useBeanValidation}} |
| 223 | + {{>beanValidation}} |
| 224 | + {{/useBeanValidation}} |
| 225 | + {{^useBeanValidation}} |
| 226 | + {{#required}}@NotNull{{/required}} |
| 227 | + {{/useBeanValidation}} |
| 228 | + {{#swagger2AnnotationLibrary}} |
| 229 | + @Schema(name = "{{{baseName}}}"{{#isReadOnly}}, accessMode = Schema.AccessMode.READ_ONLY{{/isReadOnly}}{{#example}}, example = "{{{.}}}"{{/example}}{{#description}}, description = "{{{.}}}"{{/description}}{{#deprecated}}, deprecated = true{{/deprecated}}, requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}) |
| 230 | + {{/swagger2AnnotationLibrary}} |
| 231 | + {{#swagger1AnnotationLibrary}} |
| 232 | + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}") |
| 233 | + {{/swagger1AnnotationLibrary}} |
| 234 | + {{#jackson}} |
| 235 | + @JsonProperty("{{baseName}}") |
| 236 | + {{#withXml}} |
| 237 | + @JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) |
| 238 | + {{#isContainer}} |
| 239 | + @JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}}) |
| 240 | + {{/isContainer}} |
| 241 | + {{/withXml}} |
| 242 | + {{/jackson}} |
| 243 | + {{#deprecated}} |
| 244 | + @Deprecated |
| 245 | + {{/deprecated}} |
| 246 | + public {{>nullableDataTypeBeanValidation}} {{getter}}() { |
| 247 | + return {{name}}; |
| 248 | + } |
| 249 | + {{/lombok.Getter}} |
| 250 | + |
| 251 | + {{^lombok.Setter}} |
| 252 | + {{#deprecated}} |
| 253 | + /** |
| 254 | + * @deprecated |
| 255 | + */ |
| 256 | + {{/deprecated}} |
| 257 | + {{#vendorExtensions.x-setter-extra-annotation}} |
| 258 | + {{{vendorExtensions.x-setter-extra-annotation}}} |
| 259 | + {{/vendorExtensions.x-setter-extra-annotation}} |
| 260 | + {{#deprecated}} |
| 261 | + @Deprecated |
| 262 | + {{/deprecated}} |
| 263 | + public void {{setter}}({{>nullableDataType}} {{name}}) { |
| 264 | + this.{{name}} = {{name}}; |
| 265 | + } |
| 266 | + {{/lombok.Setter}} |
| 267 | + {{/lombok.Data}} |
| 268 | + {{! end feature: getter and setter }} |
| 269 | + {{/vars}} |
| 270 | +{{>additionalProperties}} |
| 271 | + {{^lombok.Data}} |
| 272 | + {{#parentVars}} |
| 273 | + |
| 274 | + {{^lombok.Setter}} |
| 275 | + {{! begin feature: fluent setter methods for inherited properties }} |
| 276 | + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { |
| 277 | + super.{{name}}({{name}}); |
| 278 | + return this; |
| 279 | + } |
| 280 | + {{#isArray}} |
| 281 | + |
| 282 | + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { |
| 283 | + super.add{{nameInPascalCase}}Item({{name}}Item); |
| 284 | + return this; |
| 285 | + } |
| 286 | + {{/isArray}} |
| 287 | + {{#isMap}} |
| 288 | + |
| 289 | + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { |
| 290 | + super.put{{nameInPascalCase}}Item(key, {{name}}Item); |
| 291 | + return this; |
| 292 | + } |
| 293 | + {{/isMap}} |
| 294 | + {{/lombok.Setter}} |
| 295 | + {{! end feature: fluent setter methods for inherited properties }} |
| 296 | + {{/parentVars}} |
| 297 | + {{^lombok.EqualsAndHashCode}} |
| 298 | + @Override |
| 299 | + public boolean equals(Object o) { |
| 300 | + if (this == o) { |
| 301 | + return true; |
| 302 | + } |
| 303 | + if (o == null || getClass() != o.getClass()) { |
| 304 | + return false; |
| 305 | + }{{#hasVars}} |
| 306 | + {{classname}} {{classVarName}} = ({{classname}}) o; |
| 307 | + return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} && |
| 308 | + {{/-last}}{{/vars}}{{#additionalPropertiesType}} && |
| 309 | + Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/additionalPropertiesType}}{{#parent}} && |
| 310 | + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} |
| 311 | + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} |
| 312 | + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} |
| 313 | + |
| 314 | + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { |
| 315 | + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); |
| 316 | + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} |
| 317 | + |
| 318 | + @Override |
| 319 | + public int hashCode() { |
| 320 | + return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}{{#hasVars}}, {{/hasVars}}{{^hasVars}}{{#parent}}, {{/parent}}{{/hasVars}}additionalProperties{{/additionalPropertiesType}}); |
| 321 | + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} |
| 322 | + |
| 323 | + private static <T> int hashCodeNullable(JsonNullable<T> a) { |
| 324 | + if (a == null) { |
| 325 | + return 1; |
| 326 | + } |
| 327 | + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; |
| 328 | + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} |
| 329 | + {{/lombok.EqualsAndHashCode}} |
| 330 | + |
| 331 | + {{^lombok.ToString}} |
| 332 | + @Override |
| 333 | + public String toString() { |
| 334 | + StringBuilder sb = new StringBuilder(); |
| 335 | + sb.append("class {{classname}} {\n"); |
| 336 | + {{#parent}} |
| 337 | + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); |
| 338 | + {{/parent}} |
| 339 | + {{#vars}}sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); |
| 340 | + {{/vars}}{{#additionalPropertiesType}} |
| 341 | + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); |
| 342 | + {{/additionalPropertiesType}}sb.append("}"); |
| 343 | + return sb.toString(); |
| 344 | + } |
| 345 | + |
| 346 | + /** |
| 347 | + * Convert the given object to string with each line indented by 4 spaces |
| 348 | + * (except the first line). |
| 349 | + */ |
| 350 | + private String toIndentedString(Object o) { |
| 351 | + if (o == null) { |
| 352 | + return "null"; |
| 353 | + } |
| 354 | + return o.toString().replace("\n", "\n "); |
| 355 | + } |
| 356 | + {{/lombok.ToString}} |
| 357 | + {{#generateBuilders}} |
| 358 | + {{>javaBuilder}} |
| 359 | + {{/generateBuilders}} |
| 360 | + {{/lombok.Data}} |
| 361 | +} |
0 commit comments