diff options
author | Robert Henigan <robert.henigan@livio.io> | 2020-10-14 13:03:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-14 13:03:27 -0400 |
commit | d7e54de7e2127bc994d847de156ad74e6a9f574b (patch) | |
tree | 646998109fcb6a6f91e7c498931c77bcd7bee895 | |
parent | 13046fee03d5cf656d2bd39b93f7fac4dea04a88 (diff) | |
parent | 672b71b55a2aadda19c8deb8dc7b0fbb454646a0 (diff) | |
download | sdl_android-d7e54de7e2127bc994d847de156ad74e6a9f574b.tar.gz |
Merge pull request #1525 from smartdevicelink/RPC-Chainable-Generator
Make Rpc setters chainable in RPC generator
-rw-r--r-- | generator/templates/function_template.java | 3 | ||||
-rw-r--r-- | generator/templates/struct_template.java | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/generator/templates/function_template.java b/generator/templates/function_template.java index 1d95cdc40..96ac7cf99 100644 --- a/generator/templates/function_template.java +++ b/generator/templates/function_template.java @@ -31,8 +31,9 @@ {%- if p.deprecated is defined and p.deprecated is not none %} @Deprecated {%- endif %} - public void set{{p.title}}({% if p.mandatory %}@NonNull {% endif %}{{p.return_type}} {{p.last}}) { + public {{class_name}} set{{p.title}}({% if p.mandatory %}@NonNull {% endif %}{{p.return_type}} {{p.last}}) { setParameters({{p.key}}, {{p.last}}); + return this; } /** diff --git a/generator/templates/struct_template.java b/generator/templates/struct_template.java index aea04d9e7..5fcca3ba9 100644 --- a/generator/templates/struct_template.java +++ b/generator/templates/struct_template.java @@ -27,8 +27,9 @@ {%- if p.deprecated is defined and p.deprecated is not none %} @Deprecated {%- endif %} - public void set{{p.title}}({% if p.mandatory %}@NonNull {% endif %}{{p.return_type}} {{p.last}}) { + public {{class_name}} set{{p.title}}({% if p.mandatory %}@NonNull {% endif %}{{p.return_type}} {{p.last}}) { setValue({{p.key}}, {{p.last}}); + return this; } /** |