Skip to content

Commit a84dee5

Browse files
committed
fix - revert original initialiser but made it internal
1 parent e641955 commit a84dee5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

boat-scaffold/src/main/templates/boat-swift5/modelObject.mustache

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
{{/allVars}}
2626

2727
{{#hasVars}}
28-
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init() {
28+
internal init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{#required}}{{#isNullable}}? = nil{{/isNullable}}{{/required}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allVars}}) {
29+
{{#allVars}}
30+
self.{{name}} = {{name}}
31+
{{/allVars}}
2932
}
3033
{{/hasVars}}
3134

@@ -66,11 +69,8 @@
6669

6770
/// Builder initializer method for {{classname}} DTO.
6871
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func build() -> {{classname}} {
69-
var result = {{classname}}()
70-
{{#allVars}}
71-
result.{{name}} = {{name}}
72-
{{/allVars}}
73-
return result
72+
return {{classname}}({{#allVars}}{{name}}: {{name}}{{^-last}},
73+
{{/-last}}{{/allVars}})
7474
}
7575

7676
public static func ==(lhs: Builder, rhs: Builder) -> Bool {

0 commit comments

Comments
 (0)