Skip to content

Commit 3c47d09

Browse files
committed
fix - removal of deprecated code
1 parent 2c1edc7 commit 3c47d09

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

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

2727
{{#hasVars}}
28-
@available(*, deprecated, message: "This initializer is deprecated, use the initializer and the setters of {{classname}}.Builder class.")
29-
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{#required}}{{#isNullable}}? = nil{{/isNullable}}{{/required}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allVars}}) {
30-
{{#allVars}}
31-
self.{{name}} = {{name}}
32-
{{/allVars}}
28+
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init() {
29+
// All properties initialized with their default values
3330
}
3431
{{/hasVars}}
3532

@@ -70,8 +67,11 @@
7067

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

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

0 commit comments

Comments
 (0)