Skip to content

Commit d7e54de

Browse files
author
Robert Henigan
authored
Merge pull request #1525 from smartdevicelink/RPC-Chainable-Generator
Make Rpc setters chainable in RPC generator
2 parents 13046fe + 672b71b commit d7e54de

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

generator/templates/function_template.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131
{%- if p.deprecated is defined and p.deprecated is not none %}
3232
@Deprecated
3333
{%- endif %}
34-
public void set{{p.title}}({% if p.mandatory %}@NonNull {% endif %}{{p.return_type}} {{p.last}}) {
34+
public {{class_name}} set{{p.title}}({% if p.mandatory %}@NonNull {% endif %}{{p.return_type}} {{p.last}}) {
3535
setParameters({{p.key}}, {{p.last}});
36+
return this;
3637
}
3738

3839
/**

generator/templates/struct_template.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
{%- if p.deprecated is defined and p.deprecated is not none %}
2828
@Deprecated
2929
{%- endif %}
30-
public void set{{p.title}}({% if p.mandatory %}@NonNull {% endif %}{{p.return_type}} {{p.last}}) {
30+
public {{class_name}} set{{p.title}}({% if p.mandatory %}@NonNull {% endif %}{{p.return_type}} {{p.last}}) {
3131
setValue({{p.key}}, {{p.last}});
32+
return this;
3233
}
3334

3435
/**

0 commit comments

Comments
 (0)