Skip to content

Commit

Permalink
Add java empty event struct (#31128)
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhaengHeo authored and pull[bot] committed Apr 16, 2024
1 parent cce5761 commit 7408629
Show file tree
Hide file tree
Showing 2 changed files with 929 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public class ChipEventStructs {
{%- for cluster in clientClusters | sort(attribute='code') -%}
{%- set typeLookup = idl | createLookupContext(cluster) %}
{%- for event in cluster.events %}
{%- if event.fields %}
public static class {{cluster.name}}Cluster{{event.name}}Event {
{%- for field in event.fields %}
{%- set encodable = field | asEncodable(typeLookup) %}
Expand Down Expand Up @@ -133,6 +132,7 @@ public static class {{cluster.name}}Cluster{{event.name}}Event {
{%- endif -%}
;
{%- endfor %}
{%- if event.fields %}
for (StructElement element: ((StructType)tlvValue).value()) {
{%- for field in event.fields -%}
{%- set encodable = field | asEncodable(typeLookup) %}
Expand All @@ -146,6 +146,7 @@ public static class {{cluster.name}}Cluster{{event.name}}Event {
}
{%- endraw %}
}
{%- endif %}
return new {{cluster.name}}Cluster{{event.name}}Event(
{%- for field in event.fields %}
{{field.name}}{%- if loop.index0 < loop.length - 1 -%}{{","}}{%- endif %}
Expand Down Expand Up @@ -177,7 +178,6 @@ public static class {{cluster.name}}Cluster{{event.name}}Event {
return output.toString();
}
}
{%- endif %}
{%- endfor %}
{%- endfor %}
}
Loading

0 comments on commit 7408629

Please sign in to comment.